退单
This commit is contained in:
@@ -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;
|
||||
/**
|
||||
* 微信支付宝订单号
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user