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 3bea8460..cfb872d3 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 @@ -129,8 +129,10 @@ public class OrderController { int total_fee = MathUtils.objectConvertBigDecimal(map.get("payPrice")).multiply(new BigDecimal("100")).intValue(); WeChatPayReqInfo weChatPayReqInfo = new WeChatPayReqInfo(); weChatPayReqInfo.setAppid(SysConst.getSysConfig().getWxAppId()); //公众号id - weChatPayReqInfo.setOpenid(openId); weChatPayReqInfo.setMch_id(SysConst.getSysConfig().getWxMchId()); //商户号 + weChatPayReqInfo.setSub_mch_id(SysConst.getSysConfig().getWxMchId()); //子商户号 + + weChatPayReqInfo.setOpenid(openId); weChatPayReqInfo.setNonce_str(nonce_str); //随机字符串 weChatPayReqInfo.setBody(map.get("body").toString()); //商品描述 weChatPayReqInfo.setOut_trade_no(map.get("orderNo").toString()); //商户订单号 diff --git a/hai-service/src/main/java/com/hai/common/pay/entity/WeChatPayReqInfo.java b/hai-service/src/main/java/com/hai/common/pay/entity/WeChatPayReqInfo.java index 7cbe4873..c36a4c13 100644 --- a/hai-service/src/main/java/com/hai/common/pay/entity/WeChatPayReqInfo.java +++ b/hai-service/src/main/java/com/hai/common/pay/entity/WeChatPayReqInfo.java @@ -9,6 +9,7 @@ public class WeChatPayReqInfo implements Serializable { private static final long serialVersionUID = -7642108447915413137L; private String appid; // 公众号id 必填 private String mch_id; // 商户号 必填 + private String sub_mch_id; // 微信支付分配的子商户号 必填 private String nonce_str; // 随机字符串 必填 private String sign; // 签名 必填 private String device_info; // 设备号 可以为终端设备号(门店号或收银设备ID),PC网页或公众号内支付可以传"WEB" @@ -202,4 +203,11 @@ public class WeChatPayReqInfo implements Serializable { this.scene_info = scene_info; } + public String getSub_mch_id() { + return sub_mch_id; + } + + public void setSub_mch_id(String sub_mch_id) { + this.sub_mch_id = sub_mch_id; + } }