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");