|
@@ -53,17 +53,19 @@ public class RefundRecordServiceImpl extends ServiceImpl<RefundRecordMapper, Ref
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public WxNotifyReturnDTO refund(WxOrder wxOrder, String refundCode) throws Exception{
|
|
|
+ public WxNotifyReturnDTO refund(WxOrder wxOrder, String refundCode,String failCause) throws Exception{
|
|
|
+ if (failCause.length()>80){
|
|
|
+ failCause = "购买失败,详情请在小程序查看";
|
|
|
+ }
|
|
|
System.out.println("进入退款方法");
|
|
|
HttpPost httpPost = new HttpPost(wxpayConfig.getV3urlRefund());
|
|
|
httpPost.addHeader("Accept", "application/json");
|
|
|
httpPost.addHeader("Content-type","application/json; charset=utf-8");
|
|
|
ObjectMapper objectMapper = new ObjectMapper();
|
|
|
ObjectNode rootNode = objectMapper.createObjectNode();
|
|
|
-
|
|
|
rootNode.put("out_trade_no", wxOrder.getOutTradeNo())
|
|
|
.put("out_refund_no", refundCode)
|
|
|
- .put("reason", "电影购票失败")
|
|
|
+ .put("reason", failCause)
|
|
|
.put("notify_url",wxpayConfig.getNotifyUrlRefund());
|
|
|
rootNode.putObject("amount")
|
|
|
.put("refund", wxOrder.getTotal())
|