From 87dc0695d307a5fef421a704ea408ff6f046cc78 Mon Sep 17 00:00:00 2001 From: Sum1Dream <418471657@qq.com> Date: Tue, 1 Jun 2021 22:45:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cweb/controller/pay/WechatPayController.java | 7 +++---- .../com/hai/model/WxSharingOrderRequestModel.java | 10 +++++----- .../java/com/hai/model/WxSharingReceiversVO.java | 13 +++++++++++++ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java index 359d503c..29226d15 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/WechatPayController.java @@ -169,16 +169,15 @@ public class WechatPayController { wxSharingOrderRequest.setAppid("wx637bd6f7314daa46"); wxSharingOrderRequest.setNonce_str(WxUtils.makeNonStr()); - List list = new ArrayList<>(); WxSharingReceiversVO receiversVO = new WxSharingReceiversVO(); receiversVO.setAccount(wxSharingOrderRequest.getSub_mch_id()); receiversVO.setType("MERCHANT_ID"); + receiversVO.setName("嗨加油"); receiversVO.setRelation_type("SERVICE_PROVIDER"); - list.add(receiversVO); - wxSharingOrderRequest.setReceivers(JSONObject.toJSONString(list)); + wxSharingOrderRequest.setReceiver(JSONObject.toJSONString(receiversVO)); BeanMap beanMap = BeanMap.create(wxSharingOrderRequest); - wxSharingOrderRequest.setSign(WxUtils.makeSign(beanMap, "SHA256" ,"SHA256")); + wxSharingOrderRequest.setSign(WxUtils.makeSign(beanMap, "ASDfksdrgg55dDJoe5fky5u8trylDs5u" ,"SHA256")); String url = "https://api.mch.weixin.qq.com/pay/profitsharingaddreceiver"; String xm = XmlUtil.toSplitXml(wxSharingOrderRequest); diff --git a/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java b/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java index 78842c49..65a6bf3b 100644 --- a/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java +++ b/hai-service/src/main/java/com/hai/model/WxSharingOrderRequestModel.java @@ -62,7 +62,7 @@ public class WxSharingOrderRequestModel { /** * 分账接收方列表(单次分账不能即是支付商户又是接收商户,多次分账没有限制) */ - private String receivers; + private String receiver; public String getMch_id() { return mch_id; @@ -152,11 +152,11 @@ public class WxSharingOrderRequestModel { this.amount = amount; } - public String getReceivers() { - return receivers; + public String getReceiver() { + return receiver; } - public void setReceivers(String receivers) { - this.receivers = receivers; + public void setReceiver(String receiver) { + this.receiver = receiver; } } diff --git a/hai-service/src/main/java/com/hai/model/WxSharingReceiversVO.java b/hai-service/src/main/java/com/hai/model/WxSharingReceiversVO.java index 2de697f8..4bde8fcc 100644 --- a/hai-service/src/main/java/com/hai/model/WxSharingReceiversVO.java +++ b/hai-service/src/main/java/com/hai/model/WxSharingReceiversVO.java @@ -29,6 +29,11 @@ public class WxSharingReceiversVO { */ private String relation_type; + /** + * 分账接收方全称 + */ + private String name; + public String getType() { return type; } @@ -68,4 +73,12 @@ public class WxSharingReceiversVO { public void setRelation_type(String relation_type) { this.relation_type = relation_type; } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } }