Skip to content

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

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

public class WxMpPayServiceImpl implements WxMpPayService {

  private static final String PAY_BASE_URL = "https://api.mch.weixin.qq.com";
  private static final String[] TRADE_TYPES = new String[]{"JSAPI", "NATIVE", "APP"};
  private static final String[] REFUND_ACCOUNT = new String[]{"REFUND_SOURCE_RECHARGE_FUNDS", "REFUND_SOURCE_UNSETTLED_FUNDS"};
  private final Logger log = LoggerFactory.getLogger(this.getClass());
  private WxMpService wxMpService;

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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