Commit fd241994 authored by 33's avatar 33

防止重复退款

parent 2a083fc1
......@@ -259,6 +259,13 @@ public class WxPayServiceImpl implements WxPayService {
refund = new Refund();
out_refund_no = snowflakeUtil.snowflakeId();
} else {
Integer refundStatus = refund.getRefundStatus();
if (refundStatus.equals(RefundStatus.REFUNDING.getStatus())) {
throw GlobalException.newException(ResultCode.REFUND_FAILED, "当前订单正在退款中,请勿重复点击");
}
if (refundStatus.equals(RefundStatus.SUCCESS.getStatus())) {
throw GlobalException.newException(ResultCode.REFUND_FAILED, "当前订单已退款完成,请勿重复点击");
}
out_refund_no = refund.getId();
}
String url = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment