1
0
mirror of synced 2025-12-16 03:57:56 +08:00

🆕 【微信支付】增加服务商查询单笔退款的v3接口

This commit is contained in:
四叶草
2023-08-04 02:43:59 +00:00
committed by Binary Wang
parent bdafa81184
commit 8eb780200c
3 changed files with 35 additions and 1 deletions

View File

@@ -29,4 +29,16 @@ public class WxPayRefundQueryV3Request implements Serializable {
*/
@SerializedName(value = "out_refund_no")
private String outRefundNo;
/**
* <pre>
* 字段名:子商户号
* 变量名sub_mchid
* 是否必填:是
* 类型string[1, 32]
* 描述:子商户的商户号,由微信支付生成并下发。
* 示例值1900000109
* </pre>
*/
@SerializedName(value = "sub_mchid")
private String subMchid;
}

View File

@@ -868,7 +868,7 @@ public interface WxPayService {
/**
* <pre>
* 微信支付-查询退款
* 微信支付-查询退款-直连商户
* 应用场景:
* 提交退款申请后通过调用该接口查询退款状态。退款有一定延时建议在提交退款申请后1分钟发起查询退款状态一般来说零钱支付的退款5分钟内到账银行卡支付的退款1-3个工作日到账。
* 详见 <a href="https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_10.shtml">https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_10.shtml</a>
@@ -881,6 +881,21 @@ public interface WxPayService {
*/
WxPayRefundQueryV3Result refundQueryV3(WxPayRefundQueryV3Request request) throws WxPayException;
/**
* <pre>
* 微信支付-查询退款-服务商
* 应用场景:
* 提交退款申请后通过调用该接口查询退款状态。退款有一定延时建议在提交退款申请后1分钟发起查询退款状态一般来说零钱支付的退款5分钟内到账银行卡支付的退款1-3个工作日到账。
* 详见 <a href="https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_10.shtml">https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_1_10.shtml</a>
* 接口链接https://api.mch.weixin.qq.com/v3/refund/domestic/refunds/{out_refund_no}?sub_mchid={sub_mchid}
* </pre>
*
* @param request 微信退款单号
* @return 退款信息 wx pay refund query result
* @throws WxPayException the wx pay exception
*/
WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException;
/**
* 解析支付结果通知.
* 详见https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7

View File

@@ -298,6 +298,13 @@ public abstract class BaseWxPayServiceImpl implements WxPayService {
return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
}
@Override
public WxPayRefundQueryV3Result refundPartnerQueryV3(WxPayRefundQueryV3Request request) throws WxPayException {
String url = String.format("%s/v3/refund/domestic/refunds/%s?sub_mchid=%s", this.getPayBaseUrl(), request.getOutRefundNo(),request.getSubMchid());
String response = this.getV3(url);
return GSON.fromJson(response, WxPayRefundQueryV3Result.class);
}
@Override
public WxPayOrderNotifyResult parseOrderNotifyResult(String xmlData) throws WxPayException {
return this.parseOrderNotifyResult(xmlData, null);