From e5a06248f11515b1032a6702c4780edaf9094e14 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Thu, 6 Sep 2018 21:26:05 +0800 Subject: [PATCH] =?UTF-8?q?[=E5=88=86=E8=B4=A6][=E6=96=B0=E5=A2=9E]:?= =?UTF-8?q?=E5=88=86=E8=B4=A6=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/simple/pay/WxProfitSharing.java | 8 ++++++-- .../service/impl/WxProfitSharingOrderServiceImpl.java | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mallinkService/src/main/java/com/simple/pay/WxProfitSharing.java b/mallinkService/src/main/java/com/simple/pay/WxProfitSharing.java index 93686e89b..385a20a2a 100644 --- a/mallinkService/src/main/java/com/simple/pay/WxProfitSharing.java +++ b/mallinkService/src/main/java/com/simple/pay/WxProfitSharing.java @@ -28,8 +28,8 @@ public class WxProfitSharing { * @param params * @return */ - public static String pushOrder(Map params) { - return doPost(PROFIT_SHARING_URL, params); + public static String pushOrder(Map params, String certPath, String certPass) { + return doPostSSL(PROFIT_SHARING_URL, params, certPath, certPass); } /** @@ -59,4 +59,8 @@ public class WxProfitSharing { public static String doPost(String url, Map params) { return HttpUtil.payPost(url, WxPayment.toXml(params)); } + + public static String doPostSSL(String url, Map params, String certPath, String certPass) { + return HttpUtil.payPostSSL(url, WxPayment.toXml(params), certPath, certPass); + } } diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java index e835d65bb..7cd73ae62 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxProfitSharingOrderServiceImpl.java @@ -214,7 +214,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ wxProfitSharingP.setReceivers(receivers.toJSONString()); wxProfitSharingP.setSign(WxPayment.createSignHMAC(BeanUtils.toStringMap(wxProfitSharingP), payAccount.getApiKey())); - String response = WxProfitSharing.pushOrder(BeanUtils.toStringMap(wxProfitSharingP)); + String response = WxProfitSharing.pushOrder(BeanUtils.toStringMap(wxProfitSharingP), payAccount.getCertPath(), payAccount.getMchId()); Map returnMap = WxPayment.xmlToMap(response); String return_code = returnMap.get("return_code"); @@ -273,7 +273,7 @@ public class WxProfitSharingOrderServiceImpl implements WxProfitSharingOrderServ wxProfitSharingQueryP.setSign_type("HMAC-SHA256"); wxProfitSharingQueryP.setSign(WxPayment.createSignHMAC(BeanUtils.toStringMap(wxProfitSharingQueryP), payAccount.getApiKey())); - String response = WxProfitSharing.pushOrder(BeanUtils.toStringMap(wxProfitSharingQueryP)); + String response = WxProfitSharing.pushOrder(BeanUtils.toStringMap(wxProfitSharingQueryP), payAccount.getCertPath(), payAccount.getMchId()); Map returnMap = WxPayment.xmlToMap(response); String return_code = returnMap.get("return_code");