From 65ef21b2807d610867f6f2a9ef55d2214ea8377a Mon Sep 17 00:00:00 2001 From: Binary Wang Date: Sat, 30 Sep 2017 12:02:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=89=E5=8F=8A=E5=88=B0=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E5=95=86=E6=A8=A1=E5=BC=8F=E7=9A=84=E4=B8=A4=E4=B8=AA=E5=8F=82?= =?UTF-8?q?=E6=95=B0=EF=BC=8C=E5=9C=A8=E4=B8=BA=E7=A9=BA=E5=80=BC=E6=97=B6?= =?UTF-8?q?=E7=BD=AE=E4=B8=BAnull=EF=BC=8C=E4=BB=A5=E5=85=8D=E5=9C=A8?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=97=B6=E5=B0=86=E7=A9=BA=E5=80=BC=E4=BC=A0?= =?UTF-8?q?=E7=BB=99=E5=BE=AE=E4=BF=A1=E6=9C=8D=E5=8A=A1=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../github/binarywang/wxpay/bean/request/WxPayBaseRequest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayBaseRequest.java b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayBaseRequest.java index ad6f9d4c..fad6d444 100644 --- a/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayBaseRequest.java +++ b/weixin-java-pay/src/main/java/com/github/binarywang/wxpay/bean/request/WxPayBaseRequest.java @@ -173,6 +173,9 @@ public abstract class WxPayBaseRequest { public String toXML() { XStream xstream = XStreamInitializer.getInstance(); + //涉及到服务商模式的两个参数,在为空值时置为null,以免在请求时将空值传给微信服务器 + this.setSubAppId(StringUtils.trimToNull(this.getSubAppId())); + this.setSubMchId(StringUtils.trimToNull(this.getSubMchId())); xstream.processAnnotations(this.getClass()); return xstream.toXML(this); }