Skip to content

Commit fc7943e

Browse files
authored
🎨 binarywang#3154 【微信支付】修复按日下载提现异常文件接口响应异常
1 parent b569ab8 commit fc7943e

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/PayrollService.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.binarywang.wxpay.service;
22

33
import com.github.binarywang.wxpay.bean.marketing.payroll.*;
4+
import com.github.binarywang.wxpay.bean.result.WxPayApplyBillV3Result;
45
import com.github.binarywang.wxpay.exception.WxPayException;
56

67
/**
@@ -98,6 +99,6 @@ public interface PayrollService {
9899
* @return 返回数据
99100
* @throws WxPayException the wx pay exception
100101
*/
101-
PreOrderWithAuthResult merchantFundWithdrawBillType(String billType, String billDate) throws WxPayException;
102+
WxPayApplyBillV3Result merchantFundWithdrawBillType(String billType, String billDate, String tarType) throws WxPayException;
102103

103104
}

weixin-java-pay/src/main/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImpl.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.github.binarywang.wxpay.service.impl;
22

33
import com.github.binarywang.wxpay.bean.marketing.payroll.*;
4+
import com.github.binarywang.wxpay.bean.result.WxPayApplyBillV3Result;
45
import com.github.binarywang.wxpay.exception.WxPayException;
56
import com.github.binarywang.wxpay.service.PayrollService;
67
import com.github.binarywang.wxpay.service.WxPayService;
@@ -182,11 +183,14 @@ public PreOrderWithAuthResult payrollCardPreOrderWithAuth(PreOrderWithAuthReques
182183
* @throws WxPayException the wx pay exception
183184
*/
184185
@Override
185-
public PreOrderWithAuthResult merchantFundWithdrawBillType(String billType, String billDate) throws WxPayException {
186+
public WxPayApplyBillV3Result merchantFundWithdrawBillType(String billType, String billDate, String tarType) throws WxPayException {
186187
String url = String.format("%s/v3/merchant/fund/withdraw/bill-type/%s", payService.getPayBaseUrl(), billType);
187188
String query = String.format("?bill_date=%s", billDate);
189+
if (StringUtils.isNotBlank(tarType)) {
190+
query += String.format("&tar_type=%s", tarType);
191+
}
188192
String response = payService.getV3(url + query);
189-
return GSON.fromJson(response, PreOrderWithAuthResult.class);
193+
return GSON.fromJson(response, WxPayApplyBillV3Result.class);
190194
}
191195

192196
}

weixin-java-pay/src/test/java/com/github/binarywang/wxpay/service/impl/PayrollServiceImplTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import com.github.binarywang.wxpay.bean.marketing.payroll.*;
44
import com.github.binarywang.wxpay.bean.marketing.transfer.PartnerTransferRequest;
55
import com.github.binarywang.wxpay.bean.marketing.transfer.PartnerTransferResult;
6+
import com.github.binarywang.wxpay.bean.result.WxPayApplyBillV3Result;
67
import com.github.binarywang.wxpay.exception.WxPayException;
78
import com.github.binarywang.wxpay.service.WxPayService;
89
import com.github.binarywang.wxpay.testbase.ApiTestModule;
@@ -120,9 +121,8 @@ public void payrollCardPreOrderWithAuth() throws WxPayException {
120121
public void merchantFundWithdrawBillType() throws WxPayException {
121122
String billType = "NO_SUCC";
122123
String billDate = "2019-08-17";
123-
PreOrderWithAuthResult preOrderWithAuthResult = wxPayService.getPayrollService().merchantFundWithdrawBillType(billType, billDate);
124-
log.info(preOrderWithAuthResult.toString());
125-
124+
WxPayApplyBillV3Result result = wxPayService.getPayrollService().merchantFundWithdrawBillType(billType, billDate, null);
125+
log.info(result.toString());
126126
}
127127

128128
}

0 commit comments

Comments
 (0)