mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-31 02:28:25 +08:00
🎨 【微信支付】沙箱环境api地址修改sandboxnew为 xdc/apiv2sandbox
This commit is contained in:
@ -1192,7 +1192,7 @@ public interface WxPayService {
|
|||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
* 获取仿真测试系统的验签密钥.
|
* 获取仿真测试系统的验签密钥.
|
||||||
* 请求Url: https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey
|
* 请求Url: https://api.mch.weixin.qq.com/xdc/apiv2getsignkey/sign/getsignkey
|
||||||
* 是否需要证书: 否
|
* 是否需要证书: 否
|
||||||
* 请求方式: POST
|
* 请求方式: POST
|
||||||
* 文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=23_1
|
* 文档地址:https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=23_1
|
||||||
|
|||||||
@ -202,7 +202,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
@Override
|
@Override
|
||||||
public String getPayBaseUrl() {
|
public String getPayBaseUrl() {
|
||||||
if (this.getConfig().isUseSandboxEnv()) {
|
if (this.getConfig().isUseSandboxEnv()) {
|
||||||
return this.getConfig().getPayBaseUrl() + "/sandboxnew";
|
return this.getConfig().getPayBaseUrl() + "/xdc/apiv2sandbox";
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.getConfig().getPayBaseUrl();
|
return this.getConfig().getPayBaseUrl();
|
||||||
@ -213,10 +213,6 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
request.checkAndSign(this.getConfig());
|
request.checkAndSign(this.getConfig());
|
||||||
|
|
||||||
String url = this.getPayBaseUrl() + "/secapi/pay/refund";
|
String url = this.getPayBaseUrl() + "/secapi/pay/refund";
|
||||||
if (this.getConfig().isUseSandboxEnv()) {
|
|
||||||
url = this.getConfig().getPayBaseUrl() + "/sandboxnew/pay/refund";
|
|
||||||
}
|
|
||||||
|
|
||||||
String responseContent = this.post(url, request.toXML(), true);
|
String responseContent = this.post(url, request.toXML(), true);
|
||||||
WxPayRefundResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundResult.class);
|
WxPayRefundResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundResult.class);
|
||||||
result.composeRefundCoupons();
|
result.composeRefundCoupons();
|
||||||
@ -229,10 +225,6 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
request.checkAndSign(this.getConfig());
|
request.checkAndSign(this.getConfig());
|
||||||
|
|
||||||
String url = this.getPayBaseUrl() + "/secapi/pay/refundv2";
|
String url = this.getPayBaseUrl() + "/secapi/pay/refundv2";
|
||||||
if (this.getConfig().isUseSandboxEnv()) {
|
|
||||||
url = this.getConfig().getPayBaseUrl() + "/sandboxnew/pay/refundv2";
|
|
||||||
}
|
|
||||||
|
|
||||||
String responseContent = this.post(url, request.toXML(), true);
|
String responseContent = this.post(url, request.toXML(), true);
|
||||||
WxPayRefundResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundResult.class);
|
WxPayRefundResult result = BaseWxPayResult.fromXML(responseContent, WxPayRefundResult.class);
|
||||||
result.composePromotionDetails();
|
result.composePromotionDetails();
|
||||||
@ -1087,7 +1079,7 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
|||||||
WxPayDefaultRequest request = new WxPayDefaultRequest();
|
WxPayDefaultRequest request = new WxPayDefaultRequest();
|
||||||
request.checkAndSign(this.getConfig());
|
request.checkAndSign(this.getConfig());
|
||||||
|
|
||||||
String url = "https://api.mch.weixin.qq.com/sandboxnew/pay/getsignkey";
|
String url = "https://api.mch.weixin.qq.com/xdc/apiv2getsignkey/sign/getsignkey";
|
||||||
String responseContent = this.post(url, request.toXML(), false);
|
String responseContent = this.post(url, request.toXML(), false);
|
||||||
WxPaySandboxSignKeyResult result = BaseWxPayResult.fromXML(responseContent, WxPaySandboxSignKeyResult.class);
|
WxPaySandboxSignKeyResult result = BaseWxPayResult.fromXML(responseContent, WxPaySandboxSignKeyResult.class);
|
||||||
result.checkResult(this, request.getSignType(), true);
|
result.checkResult(this, request.getSignType(), true);
|
||||||
|
|||||||
Reference in New Issue
Block a user