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

* 增加微信收付通请求分账接口
This commit is contained in:
f00lish
2020-09-13 09:28:43 +08:00
committed by GitHub
parent 6c31059020
commit 91d484f730
4 changed files with 282 additions and 0 deletions

View File

@@ -174,4 +174,16 @@ public interface EcommerceService {
* @return 返回数据
*/
FundBalanceResult subDayEndBalance(String subMchid, String date) throws WxPayException;
/**
* <pre>
* 请求分账API
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_1.shtml
* </pre>
*
* @param request 分账请求
* @return 返回数据
*/
ProfitSharingResult profitSharing(ProfitSharingRequest request) throws WxPayException;
}

View File

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