修复企微兜底机制
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m40s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m40s
This commit is contained in:
@@ -409,7 +409,7 @@ func (s *Service) appendCompletedNotification(ctx context.Context, tx *gorm.DB,
|
||||
|
||||
// refundWalletPayment 处理钱包支付订单的退款回款。
|
||||
func (s *Service) refundWalletPayment(ctx context.Context, tx *gorm.DB, refund *model.RefundRequest, order *model.Order, amount int64, operatorID uint) error {
|
||||
if order.PaymentMethod != model.PaymentMethodWallet {
|
||||
if amount == 0 || order.PaymentMethod != model.PaymentMethodWallet {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1201,8 +1201,8 @@ func validateRequestedRefundAmountByOrder(requestedRefundAmount int64, order *mo
|
||||
|
||||
// validateApprovedRefundAmount 校验审批退款金额不能超过申请金额和订单实收金额。
|
||||
func validateApprovedRefundAmount(approvedAmount int64, requestedRefundAmount int64, order *model.Order) error {
|
||||
if approvedAmount <= 0 {
|
||||
return errors.New(errors.CodeInvalidParam, "审批退款金额必须大于0")
|
||||
if approvedAmount < 0 {
|
||||
return errors.New(errors.CodeInvalidParam, "审批退款金额不能小于0")
|
||||
}
|
||||
if approvedAmount > requestedRefundAmount {
|
||||
return errors.New(errors.CodeInvalidParam, "审批退款金额不能大于申请退款金额")
|
||||
|
||||
Reference in New Issue
Block a user