This commit is contained in:
wyn
2026-04-30 19:00:15 +08:00
parent a4edccc7de
commit 594c99b4dc
4 changed files with 22 additions and 8 deletions

View File

@@ -19,7 +19,9 @@ public class PayRefundOrder implements Serializable {
@TableId
private Integer refundId;
private Integer id;
private String refundId;
/**
* 支付方式 1微信2支付宝3虚拟币
@@ -29,8 +31,9 @@ public class PayRefundOrder implements Serializable {
/**
* BuyOrder
*/
private Integer orderId;
private String orderSn;
private Integer orderId;
/**
* 微信支付宝订单号
*/

View File

@@ -369,7 +369,7 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
// 这里 * 100微信支付单位为 ‘分’
BigDecimal hand = new BigDecimal("100");
Map<String, Object> amountMap = new HashMap<>();
amountMap.put("refund", refund.multiply(hand));
amountMap.put("refund", refund.multiply(hand).intValue());
amountMap.put("total", total.multiply(hand).intValue());
amountMap.put("currency", "CNY");
paramMap.put("amount", amountMap);
@@ -392,14 +392,18 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
appid = wechatPayConfig.getThyyappId();
}
// app id
paramMap.put("appid", appid);
// paramMap.put("appid", appid);
String notify_url = wechatPayConfig.getRefundNotifyUrl();
String mchName = "";
String mchid = wechatPayConfig.getMchId();
if ("trainingClass".equals(refundInfo.getOrderType())||"lsorder".equals(refundInfo.getOrderType())) {
mchName = "LS";
mchid = wechatPayConfig.getLsMchId();
notify_url = wechatPayConfig.getLsRefundNotifyUrl();
}
// paramMap.put("mchid", mchid);
paramMap.put("notify_url", notify_url);
JSONObject json = JSONObject.parseObject(JSON.toJSONString(paramMap));
@@ -470,9 +474,9 @@ public class WxpayServiceImpl extends ServiceImpl<PayWechatOrderDao, PayWechatOr
PayRefundOrder refund = new PayRefundOrder();
refund.setPayType("1");
refund.setOrderId(order.getOrderId());
refund.setRefundId(resourceMap.get("refund_id").toString());
refund.setTradeNo(resourceMap.get("transaction_id").toString());
refund.setOutTradeNo(resourceMap.get("out_trade_no").toString());
refund.setOrderSn(resourceMap.get("out_trade_no").toString());
refund.setRefundFee(((Map)resourceMap.get("amount")).get("refund").toString());
refundOrderService.save(refund);