@@ -120,7 +120,7 @@ public WxMpPayRefundResult refund(WxMpPayRefundRequest request, File keyFile)
120
120
request .setSign (sign );
121
121
122
122
String url = PAY_BASE_URL + "/secapi/pay/refund" ;
123
- String responseContent = this .executeRequestWithKeyFile (url , xstream .toXML (request ), keyFile , partnerId );
123
+ String responseContent = this .executeRequestWithKeyFile (url , keyFile , xstream .toXML (request ), partnerId );
124
124
WxMpPayRefundResult wxMpPayRefundResult = (WxMpPayRefundResult ) xstream .fromXML (responseContent );
125
125
126
126
if (!"SUCCESS" .equalsIgnoreCase (wxMpPayRefundResult .getResultCode ())
@@ -181,7 +181,7 @@ public WxRedpackResult sendRedpack(WxSendRedpackRequest request, File keyFile)
181
181
url = PAY_BASE_URL + "/mmpaymkttransfers/sendgroupredpack" ;
182
182
}
183
183
184
- String responseContent = this .executeRequestWithKeyFile (url , xstream .toXML (request ), keyFile , mchId );
184
+ String responseContent = this .executeRequestWithKeyFile (url , keyFile , xstream .toXML (request ), mchId );
185
185
WxRedpackResult redpackResult = (WxRedpackResult ) xstream
186
186
.fromXML (responseContent );
187
187
if ("FAIL" .equals (redpackResult .getResultCode ())) {
@@ -360,7 +360,7 @@ public WxEntPayResult entPay(WxEntPayRequest request, File keyFile) throws WxErr
360
360
361
361
String url = PAY_BASE_URL + "/mmpaymkttransfers/promotion/transfers" ;
362
362
363
- String responseContent = this .executeRequestWithKeyFile (xstream .toXML (request ), url , keyFile , request .getMchId ());
363
+ String responseContent = this .executeRequestWithKeyFile (url , keyFile , xstream .toXML (request ), request .getMchId ());
364
364
WxEntPayResult result = (WxEntPayResult ) xstream .fromXML (responseContent );
365
365
if ("FAIL" .equals (result .getResultCode ())) {
366
366
throw new WxErrorException (
@@ -369,7 +369,7 @@ public WxEntPayResult entPay(WxEntPayRequest request, File keyFile) throws WxErr
369
369
return result ;
370
370
}
371
371
372
- private String executeRequestWithKeyFile ( String requestStr , String url , File keyFile , String mchId ) throws WxErrorException {
372
+ private String executeRequestWithKeyFile ( String url , File keyFile , String requestStr , String mchId ) throws WxErrorException {
373
373
try (FileInputStream inputStream = new FileInputStream (keyFile )) {
374
374
KeyStore keyStore = KeyStore .getInstance ("PKCS12" );
375
375
keyStore .load (inputStream , mchId .toCharArray ());
0 commit comments