🆕 【微信支付】平台收付通(退款)增加垫付退款回补和查询垫付回补结果的接口

This commit is contained in:
YT
2024-11-24 03:26:29 +00:00
committed by Binary Wang
parent eaf5b3ac1a
commit 900f06847a
7 changed files with 315 additions and 0 deletions

View File

@@ -364,6 +364,33 @@ public interface EcommerceService {
*/
RefundQueryResult queryRefundByRefundId(String subMchid, String refundId) throws WxPayException;
/**
* <pre>
* 垫付退款回补API
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_4.shtml
* </pre>
*
* @param subMchid 二级商户号
* @param refundId 微信退款单号
* @return 返回数据 return refunds result
* @throws WxPayException the wx pay exception
*/
ReturnAdvanceResult refundsReturnAdvance(String subMchid, String refundId) throws WxPayException;
/**
* <pre>
* 查询垫付回补结果API
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter7_6_5.shtml
* </pre>
*
* @param subMchid 二级商户号
* @param refundId 微信退款单号
* @return 返回数据 return refunds result
* @throws WxPayException the wx pay exception
*/
ReturnAdvanceResult queryRefundsReturnAdvance(String subMchid, String refundId) throws WxPayException;
/**
* <pre>
* 查询退款API

View File

@@ -290,6 +290,25 @@ public class EcommerceServiceImpl implements EcommerceService {
return GSON.fromJson(response, RefundQueryResult.class);
}
@Override
public ReturnAdvanceResult refundsReturnAdvance(String subMchid, String refundId) throws WxPayException {
String url = String.format("%s/v3/ecommerce/refunds/%s/return-advance", this.payService.getPayBaseUrl(), refundId);
Map request = new HashMap();
request.put("sub_mchid",subMchid);
String response = this.payService.postV3(url, GSON.toJson(request));
return GSON.fromJson(response, ReturnAdvanceResult.class);
}
@Override
public ReturnAdvanceResult queryRefundsReturnAdvance(String subMchid, String refundId) throws WxPayException {
String url = String.format("%s/v3/ecommerce/refunds/%s/return-advance?sub_mchid=%s", this.payService.getPayBaseUrl(), refundId,subMchid);
String response = this.payService.getV3(url);
return GSON.fromJson(response, ReturnAdvanceResult.class);
}
@Override
public RefundQueryResult queryRefundByOutRefundNo(String subMchid, String outRefundNo) throws WxPayException {
String url = String.format("%s/v3/ecommerce/refunds/out-refund-no/%s?sub_mchid=%s", this.payService.getPayBaseUrl(), outRefundNo, subMchid);