Skip to content

微信支付支持仿真测试环境#119

@fivesmallq

Description

@fivesmallq

目前代码中使用的都是真实的url,微信支付本身支持设置仿真测试环境,

图1为微信支付仿真测试系统(后简称仿真系统)的简化原理图。仿真系统的API协议与正式API完全相同(API接口文档)。商户开发者只需将正式API的调用URL增加一层sandboxnew路径,即可对接到仿真系统。 例如,刷卡支付URL:https://api.mch.weixin.qq.com/pay/micropay 变更为:https://api.mch.weixin.qq.com/sandboxnew/pay/micropay。 

https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=23_1

https://github.com/Wechat-Group/weixin-java-tools/blob/develop/weixin-java-mp/src/main/java/me/chanjar/weixin/mp/api/impl/WxMpPayServiceImpl.java#L41

publicclassWxMpPayServiceImplimplementsWxMpPayService{privatestaticfinalStringPAY_BASE_URL = "https://api.mch.weixin.qq.com"; privatestaticfinalString[] TRADE_TYPES = newString[]{"JSAPI", "NATIVE", "APP"}; privatestaticfinalString[] REFUND_ACCOUNT = newString[]{"REFUND_SOURCE_RECHARGE_FUNDS", "REFUND_SOURCE_UNSETTLED_FUNDS"}; privatefinalLoggerlog = LoggerFactory.getLogger(this.getClass()); privateWxMpServicewxMpService;

这个地方写死了,提供一个对外的set方法?还是可以在配置文件中设置。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions