新增分比退款
This commit is contained in:
@@ -70,6 +70,11 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
|
||||
return false, errors.New("订单未支付,无需取消")
|
||||
}
|
||||
|
||||
// 检测退款金额
|
||||
if req.RefundAmount > orderInquiry.PaymentAmountTotal {
|
||||
return false, errors.New("退款金额不可超过实付金额")
|
||||
}
|
||||
|
||||
// 订单完成时间预留5分钟进行操作
|
||||
if !orderInquiry.CompleteTime.IsEmpty() {
|
||||
// 计算三天后的时间
|
||||
@@ -113,6 +118,7 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
|
||||
OutTradeNo: orderInquiry.InquiryNo,
|
||||
OutRefundNo: inquiryRefundNo,
|
||||
Reason: "客服取消",
|
||||
RefundAmount: int64(req.RefundAmount * 100),
|
||||
PaymentAmountTotal: int64(orderInquiry.PaymentAmountTotal * 100),
|
||||
NotifyUrl: config.C.Wechat.RefundNotifyDomain + config.C.Wechat.PatientInquiryRefundNotifyUrl,
|
||||
}
|
||||
@@ -196,7 +202,7 @@ func (r *OrderInquiryService) CancelOrderInquiry(req requests.CancelOrderInquiry
|
||||
InquiryRefundNo: inquiryRefundNo,
|
||||
RefundId: refundId,
|
||||
InquiryRefundStatus: inquiryRefundStatus,
|
||||
RefundTotal: orderInquiry.PaymentAmountTotal,
|
||||
RefundTotal: req.RefundAmount,
|
||||
RefundReason: req.CancelRemarks,
|
||||
SuccessTime: model.LocalTime(successTime),
|
||||
}
|
||||
|
||||
@@ -167,6 +167,7 @@ func (r *OrderProductService) CancelOrderProduct(req requests.CancelOrderProduct
|
||||
OutTradeNo: orderProduct.OrderProductNo,
|
||||
OutRefundNo: refundNo,
|
||||
Reason: "客服取消",
|
||||
RefundAmount: int64(orderProduct.PaymentAmountTotal * 100),
|
||||
PaymentAmountTotal: int64(orderProduct.PaymentAmountTotal * 100),
|
||||
NotifyUrl: config.C.Wechat.RefundNotifyDomain + config.C.Wechat.PatientProductRefundNotifyUrl,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user