修复订单可能签名的错误

This commit is contained in:
jinyu 2016-01-29 19:17:55 +08:00
parent 1bc05afce9
commit baff97e9db
2 changed files with 11 additions and 11 deletions

View File

@ -7,6 +7,7 @@ import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext; import javax.net.ssl.SSLContext;
import com.foxinmy.weixin4j.exception.WeixinException; import com.foxinmy.weixin4j.exception.WeixinException;
import com.foxinmy.weixin4j.model.Consts;
/** /**
* 微信ssl请求 * 微信ssl请求
@ -24,11 +25,10 @@ public class WeixinSSLRequestExecutor extends WeixinRequestExecutor {
public WeixinSSLRequestExecutor(String password, InputStream inputStream) public WeixinSSLRequestExecutor(String password, InputStream inputStream)
throws WeixinException { throws WeixinException {
try { try {
KeyStore keyStore = KeyStore KeyStore keyStore = KeyStore.getInstance(Consts.PKCS12);
.getInstance(com.foxinmy.weixin4j.model.Consts.PKCS12);
keyStore.load(inputStream, password.toCharArray()); keyStore.load(inputStream, password.toCharArray());
KeyManagerFactory kmf = KeyManagerFactory KeyManagerFactory kmf = KeyManagerFactory
.getInstance(com.foxinmy.weixin4j.model.Consts.SunX509); .getInstance(Consts.SunX509);
kmf.init(keyStore, password.toCharArray()); kmf.init(keyStore, password.toCharArray());
sslContext = SSLContext.getInstance("TLS"); sslContext = SSLContext.getInstance("TLS");
sslContext.init(kmf.getKeyManagers(), null, sslContext.init(kmf.getKeyManagers(), null,

View File

@ -70,7 +70,7 @@ public class Order extends ApiResult {
*/ */
@XmlElement(name = "total_fee") @XmlElement(name = "total_fee")
@JSONField(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") @XmlElement(name = "cash_fee")
@JSONField(name = "cash_fee") @JSONField(name = "cash_fee")
private int cashFee; private Integer cashFee;
/** /**
* 货币类型,符合 ISO 4217 标准的三位字母代码,默认人民币:CNY * 货币类型,符合 ISO 4217 标准的三位字母代码,默认人民币:CNY
* *
@ -170,7 +170,7 @@ public class Order extends ApiResult {
: null; : null;
} }
public int getTotalFee() { public Integer getTotalFee() {
return totalFee; return totalFee;
} }
@ -181,7 +181,7 @@ public class Order extends ApiResult {
*/ */
@JSONField(serialize = false) @JSONField(serialize = false)
public double getFormatTotalFee() { public double getFormatTotalFee() {
return totalFee / 100d; return totalFee != null ? totalFee / 100d : 0d;
} }
public Integer getCouponFee() { public Integer getCouponFee() {
@ -202,7 +202,7 @@ public class Order extends ApiResult {
return couponCount; return couponCount;
} }
public int getCashFee() { public Integer getCashFee() {
return cashFee; return cashFee;
} }
@ -213,7 +213,7 @@ public class Order extends ApiResult {
*/ */
@JSONField(serialize = false) @JSONField(serialize = false)
public double getFormatCashFee() { public double getFormatCashFee() {
return cashFee / 100d; return cashFee != null ? cashFee / 100d : 0d;
} }
@JSONField(serialize = false) @JSONField(serialize = false)
@ -270,8 +270,8 @@ public class Order extends ApiResult {
@Override @Override
public String toString() { public String toString() {
return "Order [tradeState=" + tradeState + ", openId=" + openId return "Order [tradeState=" + tradeState + ", openId=" + openId
+ ", isSubscribe=" + getFormatIsSubscribe() + ", tradeType=" + ", isSubscribe=" + isSubscribe + ", tradeType=" + tradeType
+ tradeType + ", bankType=" + bankType + ", feeType=" + feeType + ", bankType=" + bankType + ", feeType=" + feeType
+ ", transactionId=" + transactionId + ", outTradeNo=" + ", transactionId=" + transactionId + ", outTradeNo="
+ outTradeNo + ", attach=" + attach + ", timeEnd=" + timeEnd + outTradeNo + ", attach=" + attach + ", timeEnd=" + timeEnd
+ ", totalFee=" + getFormatTotalFee() + ", couponFee=" + ", totalFee=" + getFormatTotalFee() + ", couponFee="