🆕 #1764 微信支付电商收付通增加请求分账回退接口

This commit is contained in:
f00lish
2020-09-14 12:28:35 +08:00
committed by GitHub
parent cc83bcb415
commit 7c10cdd078
4 changed files with 307 additions and 0 deletions

View File

@@ -201,4 +201,16 @@ public interface EcommerceService {
*/
ProfitSharingResult profitSharing(ProfitSharingRequest request) throws WxPayException;
/**
* <pre>
* 请求分账回退API
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_3.shtml
* </pre>
*
* @param request 分账回退请求
* @return 返回数据 return orders result
* @throws WxPayException the wx pay exception
*/
ReturnOrdersResult returnOrders(ReturnOrdersRequest request) throws WxPayException;
}

View File

@@ -155,6 +155,13 @@ public class EcommerceServiceImpl implements EcommerceService {
return GSON.fromJson(response, ProfitSharingResult.class);
}
@Override
public ReturnOrdersResult returnOrders(ReturnOrdersRequest request) throws WxPayException {
String url = String.format("%s/v3/ecommerce/profitsharing/returnorders", this.payService.getPayBaseUrl());
String response = this.payService.postV3(url, GSON.toJson(request));
return GSON.fromJson(response, ReturnOrdersResult.class);
}
private boolean verifyNotifySign(SignatureHeader header, String data) {
String beforeSign = String.format("%s\n%s\n%s\n",
header.getTimeStamp(),