| @@ -11,6 +11,7 @@ public class WxPayOrderSP { | |||||
| private String sub_mch_id; // 特约商户号 | private String sub_mch_id; // 特约商户号 | ||||
| private String nonce_str; // 随机字符串 | private String nonce_str; // 随机字符串 | ||||
| private String sign; // 签名 | private String sign; // 签名 | ||||
| private String sign_type; // 签名类型 | |||||
| private String body; // 商品简单描述 128 | private String body; // 商品简单描述 128 | ||||
| private String out_trade_no; // 商户订单号 | private String out_trade_no; // 商户订单号 | ||||
| private Integer total_fee; // 支付金额 | private Integer total_fee; // 支付金额 | ||||
| @@ -86,6 +87,14 @@ public class WxPayOrderSP { | |||||
| this.sign = sign; | this.sign = sign; | ||||
| } | } | ||||
| public String getSign_type() { | |||||
| return sign_type; | |||||
| } | |||||
| public void setSign_type(String sign_type) { | |||||
| this.sign_type = sign_type; | |||||
| } | |||||
| public String getBody() { | public String getBody() { | ||||
| return body; | return body; | ||||
| } | } | ||||
| @@ -10,6 +10,7 @@ public class WxPayOrderSQ { | |||||
| private String sub_mch_id; // 特约商户号 | private String sub_mch_id; // 特约商户号 | ||||
| private String nonce_str; // 随机字符串 | private String nonce_str; // 随机字符串 | ||||
| private String sign; // 签名 | private String sign; // 签名 | ||||
| private String sign_type; // 签名类型 | |||||
| private String out_trade_no; // 商户订单号 | private String out_trade_no; // 商户订单号 | ||||
| @@ -61,6 +62,14 @@ public class WxPayOrderSQ { | |||||
| this.sign = sign; | this.sign = sign; | ||||
| } | } | ||||
| public String getSign_type() { | |||||
| return sign_type; | |||||
| } | |||||
| public void setSign_type(String sign_type) { | |||||
| this.sign_type = sign_type; | |||||
| } | |||||
| public String getOut_trade_no() { | public String getOut_trade_no() { | ||||
| return out_trade_no; | return out_trade_no; | ||||
| } | } | ||||
| @@ -10,6 +10,7 @@ public class WxRefundOrderSP { | |||||
| private String sub_mch_id; // 特约商户号 | private String sub_mch_id; // 特约商户号 | ||||
| private String nonce_str; // 随机字符串 | private String nonce_str; // 随机字符串 | ||||
| private String sign; // 签名 | private String sign; // 签名 | ||||
| private String sign_type; // 签名类型 | |||||
| private String transaction_id; // 微信订单号 | private String transaction_id; // 微信订单号 | ||||
| private String out_trade_no; // 商户订单号 | private String out_trade_no; // 商户订单号 | ||||
| private String out_refund_no; // 商户退款单号 | private String out_refund_no; // 商户退款单号 | ||||
| @@ -66,6 +67,14 @@ public class WxRefundOrderSP { | |||||
| this.sign = sign; | this.sign = sign; | ||||
| } | } | ||||
| public String getSign_type() { | |||||
| return sign_type; | |||||
| } | |||||
| public void setSign_type(String sign_type) { | |||||
| this.sign_type = sign_type; | |||||
| } | |||||
| public String getTransaction_id() { | public String getTransaction_id() { | ||||
| return transaction_id; | return transaction_id; | ||||
| } | } | ||||
| @@ -226,6 +226,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| if(isShare) { | if(isShare) { | ||||
| payOrderMap.put("profit_sharing", "Y"); | payOrderMap.put("profit_sharing", "Y"); | ||||
| } | } | ||||
| wxPayOrderSP.setSign_type("HMAC-SHA256"); | |||||
| wxPayOrderSP.setSign(WxPayment.createSignHMAC(payOrderMap, payAccount.getApiKey())); | wxPayOrderSP.setSign(WxPayment.createSignHMAC(payOrderMap, payAccount.getApiKey())); | ||||
| String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderSP)); | String response = WxPay.pushOrder(BeanUtils.toStringMap(wxPayOrderSP)); | ||||
| logger.info("pay order, wechat pushOrder, " + wxPayOrderSP.toString() + ", response: " + response.toString()); | logger.info("pay order, wechat pushOrder, " + wxPayOrderSP.toString() + ", response: " + response.toString()); | ||||
| @@ -360,6 +361,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| try { | try { | ||||
| Map map = BeanUtils.toStringMap(payOrderSQ); | Map map = BeanUtils.toStringMap(payOrderSQ); | ||||
| payOrderSQ.setSign_type("HMAC-SHA256"); | |||||
| payOrderSQ.setSign(WxPayment.createSignHMAC(map, payAccount.getApiKey())); | payOrderSQ.setSign(WxPayment.createSignHMAC(map, payAccount.getApiKey())); | ||||
| map = BeanUtils.toStringMap(payOrderSQ); | map = BeanUtils.toStringMap(payOrderSQ); | ||||
| @@ -450,6 +452,7 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { | |||||
| try { | try { | ||||
| Map map = BeanUtils.toStringMap(payOrderSC); | Map map = BeanUtils.toStringMap(payOrderSC); | ||||
| payOrderSC.setSign_type("HMAC-SHA256"); | |||||
| payOrderSC.setSign(WxPayment.createSignHMAC(map, payAccount.getApiKey())); | payOrderSC.setSign(WxPayment.createSignHMAC(map, payAccount.getApiKey())); | ||||
| map = BeanUtils.toStringMap(payOrderSC); | map = BeanUtils.toStringMap(payOrderSC); | ||||
| String response = WxPay.closeOrder(map); | String response = WxPay.closeOrder(map); | ||||
| @@ -512,6 +512,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService { | |||||
| } | } | ||||
| String signAgent = WxPayment.createSignHMAC(signMap, payAccount.getApiKey()); | String signAgent = WxPayment.createSignHMAC(signMap, payAccount.getApiKey()); | ||||
| signMap.put("sign_type", "HMAC-SHA256"); | |||||
| signMap.put("sign", signAgent); | signMap.put("sign", signAgent); | ||||
| String response = null; | String response = null; | ||||
| try { | try { | ||||