|
@@ -85,15 +85,16 @@ public class WxApiService {
|
|
|
log.info("退款申请:{}", JSON.toJSONStringWithDateFormat(param, "yyyy-MM-dd HH:mm:ss"));
|
|
|
String nonceStr = SnowFlakeId.instance().nextId();
|
|
|
String outRefundNo = SnowFlakeId.instance().nextId();
|
|
|
- String refundFee = DecimalUtil.moneyYuanToFen(param.getTotalFee());
|
|
|
+ String totalFee = DecimalUtil.moneyYuanToFen(param.getTotalFee());
|
|
|
+ String cashpayAmt = DecimalUtil.moneyYuanToFen(param.getCashpayAmt());
|
|
|
TreeMap<String, String> map = new TreeMap<>();
|
|
|
map.put("appid", WxCertUtil.APP_ID);
|
|
|
map.put("mch_id", WxCertUtil.MERCHANT_ID);
|
|
|
map.put("nonce_str", nonceStr);
|
|
|
map.put("out_refund_no", outRefundNo);
|
|
|
map.put("out_trade_no", param.getTradeNo());
|
|
|
- map.put("refund_fee", refundFee);
|
|
|
- map.put("total_fee", refundFee);
|
|
|
+ map.put("refund_fee", cashpayAmt);
|
|
|
+ map.put("total_fee", totalFee);
|
|
|
String refundSign = Md5Util.createWxPaySign(map);
|
|
|
String xml = "<xml>" +
|
|
|
"<appid>" + WxCertUtil.APP_ID + "</appid>" +
|
|
@@ -101,8 +102,8 @@ public class WxApiService {
|
|
|
"<nonce_str>" + nonceStr + "</nonce_str>" +
|
|
|
"<out_refund_no>" + outRefundNo + "</out_refund_no>" +
|
|
|
"<out_trade_no>" + param.getTradeNo() + "</out_trade_no>" +
|
|
|
- "<refund_fee>" + refundFee + "</refund_fee>" +
|
|
|
- "<total_fee>" + refundFee + "</total_fee>" +
|
|
|
+ "<refund_fee>" + cashpayAmt + "</refund_fee>" +
|
|
|
+ "<total_fee>" + totalFee + "</total_fee>" +
|
|
|
"<sign>" + refundSign + "</sign>" +
|
|
|
"</xml>";
|
|
|
String str = requestWithSsl(xml);
|