mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
:new:【微信支付】支持服务商模式的扣款服务接口
This commit is contained in:
@@ -86,6 +86,24 @@ public interface WxEntrustPapService {
|
||||
*/
|
||||
WxWithholdResult withhold(WxWithholdRequest wxWithholdRequest) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 服务商模式的申请扣款
|
||||
* <pre>
|
||||
* 申请扣款
|
||||
* 详见:<a href="https://pay.weixin.qq.com/wiki/doc/api/wxpay_v2/papay/chapter5_8.shtml">https://pay.weixin.qq.com/wiki/doc/api/wxpay_v2/papay/chapter5_8.shtml</a>
|
||||
* 请求微信发起委托扣款,扣款额度和次数由使用的签约模板限制,
|
||||
* 该扣款接口是立即扣款 无延时 扣款前无消息通知。
|
||||
*
|
||||
* • 特殊情况:周期扣费为通知后24小时扣费方式情况下,如果用户为首次签约(包含解约后重新签约),
|
||||
* 从用户签约成功时间开始算,商户在12小时内发起的扣款,会被立即执行,无延迟。商户超过12小时以后发起的扣款,都按24小时扣费规则执行
|
||||
* </pre>
|
||||
*
|
||||
* @param wxWithholdRequest the wx withhold request
|
||||
* @return wx withhold result
|
||||
* @throws WxPayException the wx pay exception
|
||||
*/
|
||||
WxPayCommonResult withholdPartner(WxWithholdRequest wxWithholdRequest) throws WxPayException;
|
||||
|
||||
/**
|
||||
* 预扣费通知
|
||||
* <pre>
|
||||
|
||||
@@ -101,6 +101,16 @@ public class WxEntrustPapServiceImpl implements WxEntrustPapService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WxPayCommonResult withholdPartner(WxWithholdRequest wxWithholdRequest) throws WxPayException {
|
||||
wxWithholdRequest.checkAndSign(payService.getConfig());
|
||||
String url = payService.getPayBaseUrl() + "/pay/partner/pappayapply";
|
||||
String responseContent = payService.post(url, wxWithholdRequest.toXML(), false);
|
||||
WxPayCommonResult result = BaseWxPayResult.fromXML(responseContent, WxPayCommonResult.class);
|
||||
result.checkResult(payService, wxWithholdRequest.getSignType(), true);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String preWithhold(WxPreWithholdRequest wxPreWithholdRequest) throws WxPayException {
|
||||
String requestParam = WxGsonBuilder.create().toJson(wxPreWithholdRequest);
|
||||
|
||||
Reference in New Issue
Block a user