1
0
mirror of synced 2025-12-25 12:08:00 +08:00

:new:【微信支付】支持服务商模式的扣款服务接口

This commit is contained in:
luckyxz
2023-02-18 14:56:01 +00:00
committed by binarywang
parent b83435281d
commit 59074bae86
4 changed files with 61 additions and 0 deletions

View File

@@ -177,6 +177,31 @@ public class WxEntrustPapServiceTest {
}
}
@Test
public void testWithholdPartner() {
String outTradeNo = "101010101";
WxWithholdRequest withholdRequest = WxWithholdRequest.newBuilder()
.attach("local")
.body("产品名字")
.contractId("202011065409471222") // 微信返回的签约协议号
.detail("产品描述")
.feeType("CNY")
//.goodsTag()
.notifyUrl("http://domain.com/api/wxpay/withhold/callback.do")
.outTradeNo(outTradeNo)
.spbillCreateIp("127.0.0.1")
.totalFee(1)
.tradeType("PAP")
.build();
try {
WxPayCommonResult wxPayCommonResult = this.payService.getWxEntrustPapService().withholdPartner(withholdRequest);
logger.info(wxPayCommonResult.toString());
} catch (WxPayException e) {
e.printStackTrace();
}
}
@Test
public void testPreWithhold() {
WxPreWithholdRequest.EstimateAmount estimateAmount = new WxPreWithholdRequest.EstimateAmount();