From d5c1040c4cf1ef2687962ee55a38a60357a1a8f1 Mon Sep 17 00:00:00 2001 From: 199901012 Date: Sat, 27 Mar 2021 22:50:17 +0800 Subject: [PATCH] =?UTF-8?q?'=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hai-cweb/src/main/java/com/cweb/config/SysConfig.java | 9 +++++++++ .../java/com/cweb/controller/pay/OrderController.java | 2 +- hai-cweb/src/main/resources/dev/config.properties | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/config/SysConfig.java b/hai-cweb/src/main/java/com/cweb/config/SysConfig.java index ebea48eb..17ac6441 100644 --- a/hai-cweb/src/main/java/com/cweb/config/SysConfig.java +++ b/hai-cweb/src/main/java/com/cweb/config/SysConfig.java @@ -15,6 +15,7 @@ public class SysConfig { private String wxAppSecret; private String wxApiKey; private String wxMchId; + private String wxMchAppId; private String wxSubMchId; private String wxUnifiedOrderUrl; private String couponCodePath; @@ -91,4 +92,12 @@ public class SysConfig { public void setWxSubMchId(String wxSubMchId) { this.wxSubMchId = wxSubMchId; } + + public String getWxMchAppId() { + return wxMchAppId; + } + + public void setWxMchAppId(String wxMchAppId) { + this.wxMchAppId = wxMchAppId; + } } diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java index e937852a..4b80a252 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/OrderController.java @@ -128,7 +128,7 @@ public class OrderController { String nonce_str = MD5Util.MD5Encode(String.valueOf(ThreadLocalRandom.current().nextInt(10000)), "UTF-8"); int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue(); WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo(); - weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxAppId()); //公众号id + weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxMchAppId()); //公众号id weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxMchId()); //商户号 weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxSubMchId()); //子商户号 diff --git a/hai-cweb/src/main/resources/dev/config.properties b/hai-cweb/src/main/resources/dev/config.properties index 31c06aa0..278aa048 100644 --- a/hai-cweb/src/main/resources/dev/config.properties +++ b/hai-cweb/src/main/resources/dev/config.properties @@ -1,7 +1,10 @@ # ΢ -wxAppId=wx637bd6f7314daa46 +wxAppId=wx8d49e2f83025229d wxAppSecret=d8d6dcaef77d3b659258a01b5ddba5df + + wxApiKey=HfkjWxPayHaiShengGuang0123456789 +wxMchAppId=wx637bd6f7314daa46 wxMchId=1289663601 wxSubMchId=1603942866 wxUnifiedOrderUrl=https://api.mch.weixin.qq.com/pay/unifiedorder