From baff97e9dbfdae01d48a6accfa2a405da148a113 Mon Sep 17 00:00:00 2001 From: jinyu Date: Fri, 29 Jan 2016 19:17:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=AE=A2=E5=8D=95=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E7=AD=BE=E5=90=8D=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../http/weixin/WeixinSSLRequestExecutor.java | 6 +++--- .../com/foxinmy/weixin4j/payment/mch/Order.java | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/weixin4j-base/src/main/java/com/foxinmy/weixin4j/http/weixin/WeixinSSLRequestExecutor.java b/weixin4j-base/src/main/java/com/foxinmy/weixin4j/http/weixin/WeixinSSLRequestExecutor.java index d3c34a25..ba35b341 100644 --- a/weixin4j-base/src/main/java/com/foxinmy/weixin4j/http/weixin/WeixinSSLRequestExecutor.java +++ b/weixin4j-base/src/main/java/com/foxinmy/weixin4j/http/weixin/WeixinSSLRequestExecutor.java @@ -7,6 +7,7 @@ import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import com.foxinmy.weixin4j.exception.WeixinException; +import com.foxinmy.weixin4j.model.Consts; /** * 微信ssl请求 @@ -24,11 +25,10 @@ public class WeixinSSLRequestExecutor extends WeixinRequestExecutor { public WeixinSSLRequestExecutor(String password, InputStream inputStream) throws WeixinException { try { - KeyStore keyStore = KeyStore - .getInstance(com.foxinmy.weixin4j.model.Consts.PKCS12); + KeyStore keyStore = KeyStore.getInstance(Consts.PKCS12); keyStore.load(inputStream, password.toCharArray()); KeyManagerFactory kmf = KeyManagerFactory - .getInstance(com.foxinmy.weixin4j.model.Consts.SunX509); + .getInstance(Consts.SunX509); kmf.init(keyStore, password.toCharArray()); sslContext = SSLContext.getInstance("TLS"); sslContext.init(kmf.getKeyManagers(), null, diff --git a/weixin4j-base/src/main/java/com/foxinmy/weixin4j/payment/mch/Order.java b/weixin4j-base/src/main/java/com/foxinmy/weixin4j/payment/mch/Order.java index 2442f4f4..e12c4353 100644 --- a/weixin4j-base/src/main/java/com/foxinmy/weixin4j/payment/mch/Order.java +++ b/weixin4j-base/src/main/java/com/foxinmy/weixin4j/payment/mch/Order.java @@ -70,7 +70,7 @@ public class Order extends ApiResult { */ @XmlElement(name = "total_fee") @JSONField(name = "total_fee") - private int totalFee; + private Integer totalFee; /** * 现金券支付金额<=订单总金 额,订单总金额-现金券金额 为现金支付金额 */ @@ -93,7 +93,7 @@ public class Order extends ApiResult { */ @XmlElement(name = "cash_fee") @JSONField(name = "cash_fee") - private int cashFee; + private Integer cashFee; /** * 货币类型,符合 ISO 4217 标准的三位字母代码,默认人民币:CNY * @@ -170,7 +170,7 @@ public class Order extends ApiResult { : null; } - public int getTotalFee() { + public Integer getTotalFee() { return totalFee; } @@ -181,7 +181,7 @@ public class Order extends ApiResult { */ @JSONField(serialize = false) public double getFormatTotalFee() { - return totalFee / 100d; + return totalFee != null ? totalFee / 100d : 0d; } public Integer getCouponFee() { @@ -202,7 +202,7 @@ public class Order extends ApiResult { return couponCount; } - public int getCashFee() { + public Integer getCashFee() { return cashFee; } @@ -213,7 +213,7 @@ public class Order extends ApiResult { */ @JSONField(serialize = false) public double getFormatCashFee() { - return cashFee / 100d; + return cashFee != null ? cashFee / 100d : 0d; } @JSONField(serialize = false) @@ -270,8 +270,8 @@ public class Order extends ApiResult { @Override public String toString() { return "Order [tradeState=" + tradeState + ", openId=" + openId - + ", isSubscribe=" + getFormatIsSubscribe() + ", tradeType=" - + tradeType + ", bankType=" + bankType + ", feeType=" + feeType + + ", isSubscribe=" + isSubscribe + ", tradeType=" + tradeType + + ", bankType=" + bankType + ", feeType=" + feeType + ", transactionId=" + transactionId + ", outTradeNo=" + outTradeNo + ", attach=" + attach + ", timeEnd=" + timeEnd + ", totalFee=" + getFormatTotalFee() + ", couponFee="