mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-02-17 05:48:12 +08:00
@@ -213,4 +213,28 @@ public interface EcommerceService {
|
||||
*/
|
||||
ReturnOrdersResult returnOrders(ReturnOrdersRequest request) throws WxPayException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 完结分账API
|
||||
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/profitsharing/chapter3_5.shtml
|
||||
* </pre>
|
||||
*
|
||||
* @param request 完结分账请求
|
||||
* @return 返回数据 return orders result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
ProfitSharingResult finishOrder(FinishOrderRequest request) throws WxPayException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 退款申请API
|
||||
* 文档地址: https://pay.weixin.qq.com/wiki/doc/apiv3/wxpay/ecommerce/refunds/chapter3_1.shtml
|
||||
* </pre>
|
||||
*
|
||||
* @param request 退款请求
|
||||
* @return 返回数据 return refunds result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
RefundsResult refunds(RefundsRequest request) throws WxPayException;
|
||||
|
||||
}
|
||||
|
||||
@@ -162,6 +162,20 @@ public class EcommerceServiceImpl implements EcommerceService {
|
||||
return GSON.fromJson(response, ReturnOrdersResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfitSharingResult finishOrder(FinishOrderRequest request) throws WxPayException {
|
||||
String url = String.format("%s/v3/ecommerce/profitsharing/finish-order", this.payService.getPayBaseUrl());
|
||||
String response = this.payService.postV3(url, GSON.toJson(request));
|
||||
return GSON.fromJson(response, ProfitSharingResult.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RefundsResult refunds(RefundsRequest request) throws WxPayException {
|
||||
String url = String.format("%s/v3/ecommerce/refunds/apply", this.payService.getPayBaseUrl());
|
||||
String response = this.payService.postV3(url, GSON.toJson(request));
|
||||
return GSON.fromJson(response, RefundsResult.class);
|
||||
}
|
||||
|
||||
private boolean verifyNotifySign(SignatureHeader header, String data) {
|
||||
String beforeSign = String.format("%s\n%s\n%s\n",
|
||||
header.getTimeStamp(),
|
||||
|
||||
Reference in New Issue
Block a user