mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-01-23 13:22:04 +08:00
🎨 #3838 【微信支付】为starter添加了退款结果回调 URL 的配置支持,允许开发者在配置文件中统一配置退款通知地址
This commit is contained in:
@@ -230,7 +230,9 @@ public class WxPayRefundRequest extends BaseWxPayRequest {
|
||||
if (StringUtils.isBlank(this.getOpUserId())) {
|
||||
this.setOpUserId(config.getMchId());
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(this.getNotifyUrl())) {
|
||||
this.setNotifyUrl(config.getRefundNotifyUrl());
|
||||
}
|
||||
super.checkAndSign(config);
|
||||
}
|
||||
|
||||
|
||||
@@ -97,9 +97,13 @@ public class WxPayConfig {
|
||||
*/
|
||||
private String subMchId;
|
||||
/**
|
||||
* 微信支付异步回掉地址,通知url必须为直接可访问的url,不能携带参数.
|
||||
* 微信支付异步回调地址,通知url必须为直接可访问的url,不能携带参数.
|
||||
*/
|
||||
private String notifyUrl;
|
||||
/**
|
||||
* 退款结果异步回调地址,通知url必须为直接可访问的url,不能携带参数.
|
||||
*/
|
||||
private String refundNotifyUrl;
|
||||
/**
|
||||
* 交易类型.
|
||||
* <pre>
|
||||
|
||||
@@ -263,6 +263,9 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
|
||||
@Override
|
||||
public WxPayRefundV3Result refundV3(WxPayRefundV3Request request) throws WxPayException {
|
||||
if (StringUtils.isBlank(request.getNotifyUrl())) {
|
||||
request.setNotifyUrl(this.getConfig().getRefundNotifyUrl());
|
||||
}
|
||||
String url = String.format("%s/v3/refund/domestic/refunds", this.getPayBaseUrl());
|
||||
String response = this.postV3WithWechatpaySerial(url, GSON.toJson(request));
|
||||
return GSON.fromJson(response, WxPayRefundV3Result.class);
|
||||
@@ -270,6 +273,9 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
|
||||
|
||||
@Override
|
||||
public WxPayRefundV3Result partnerRefundV3(WxPayPartnerRefundV3Request request) throws WxPayException {
|
||||
if (StringUtils.isBlank(request.getNotifyUrl())) {
|
||||
request.setNotifyUrl(this.getConfig().getRefundNotifyUrl());
|
||||
}
|
||||
if (StringUtils.isBlank(request.getSubMchid())) {
|
||||
request.setSubMchid(this.getConfig().getSubMchId());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user