mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-24 07:23:01 +08:00
调整参数位置
This commit is contained in:
parent
f7f7d12347
commit
3d9bc6be0f
@ -120,7 +120,7 @@ public class WxMpPayServiceImpl implements WxMpPayService {
|
|||||||
request.setSign(sign);
|
request.setSign(sign);
|
||||||
|
|
||||||
String url = PAY_BASE_URL + "/secapi/pay/refund";
|
String url = PAY_BASE_URL + "/secapi/pay/refund";
|
||||||
String responseContent = this.executeRequestWithKeyFile(url, xstream.toXML(request), keyFile, partnerId);
|
String responseContent = this.executeRequestWithKeyFile(url, keyFile, xstream.toXML(request), partnerId);
|
||||||
WxMpPayRefundResult wxMpPayRefundResult = (WxMpPayRefundResult) xstream.fromXML(responseContent);
|
WxMpPayRefundResult wxMpPayRefundResult = (WxMpPayRefundResult) xstream.fromXML(responseContent);
|
||||||
|
|
||||||
if (!"SUCCESS".equalsIgnoreCase(wxMpPayRefundResult.getResultCode())
|
if (!"SUCCESS".equalsIgnoreCase(wxMpPayRefundResult.getResultCode())
|
||||||
@ -181,7 +181,7 @@ public class WxMpPayServiceImpl implements WxMpPayService {
|
|||||||
url = PAY_BASE_URL + "/mmpaymkttransfers/sendgroupredpack";
|
url = PAY_BASE_URL + "/mmpaymkttransfers/sendgroupredpack";
|
||||||
}
|
}
|
||||||
|
|
||||||
String responseContent = this.executeRequestWithKeyFile(url, xstream.toXML(request), keyFile, mchId);
|
String responseContent = this.executeRequestWithKeyFile(url, keyFile, xstream.toXML(request), mchId);
|
||||||
WxRedpackResult redpackResult = (WxRedpackResult) xstream
|
WxRedpackResult redpackResult = (WxRedpackResult) xstream
|
||||||
.fromXML(responseContent);
|
.fromXML(responseContent);
|
||||||
if ("FAIL".equals(redpackResult.getResultCode())) {
|
if ("FAIL".equals(redpackResult.getResultCode())) {
|
||||||
@ -360,7 +360,7 @@ public class WxMpPayServiceImpl implements WxMpPayService {
|
|||||||
|
|
||||||
String url = PAY_BASE_URL + "/mmpaymkttransfers/promotion/transfers";
|
String url = PAY_BASE_URL + "/mmpaymkttransfers/promotion/transfers";
|
||||||
|
|
||||||
String responseContent = this.executeRequestWithKeyFile(xstream.toXML(request), url, keyFile, request.getMchId());
|
String responseContent = this.executeRequestWithKeyFile(url, keyFile, xstream.toXML(request), request.getMchId());
|
||||||
WxEntPayResult result = (WxEntPayResult) xstream.fromXML(responseContent);
|
WxEntPayResult result = (WxEntPayResult) xstream.fromXML(responseContent);
|
||||||
if ("FAIL".equals(result.getResultCode())) {
|
if ("FAIL".equals(result.getResultCode())) {
|
||||||
throw new WxErrorException(
|
throw new WxErrorException(
|
||||||
@ -369,7 +369,7 @@ public class WxMpPayServiceImpl implements WxMpPayService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String executeRequestWithKeyFile( String requestStr, String url, File keyFile, String mchId) throws WxErrorException {
|
private String executeRequestWithKeyFile( String url, File keyFile, String requestStr, String mchId) throws WxErrorException {
|
||||||
try (FileInputStream inputStream = new FileInputStream(keyFile)) {
|
try (FileInputStream inputStream = new FileInputStream(keyFile)) {
|
||||||
KeyStore keyStore = KeyStore.getInstance("PKCS12");
|
KeyStore keyStore = KeyStore.getInstance("PKCS12");
|
||||||
keyStore.load(inputStream, mchId.toCharArray());
|
keyStore.load(inputStream, mchId.toCharArray());
|
||||||
|
Loading…
Reference in New Issue
Block a user