fix: 退款审批通过时仅原路退款校验收款商户凭证
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m3s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 10m3s
线上支付订单选择客户收款信息退款时,审批通过处理仍无条件校验收款商户的原路退款凭证, 商户凭证不完整(如微信 v2 缺 API 客户端证书)即阻断,导致企微已通过的退款无法完成。 将凭证校验移入原路退款分支,旧人工审批入口同步按退款方式判定。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -113,9 +113,6 @@ func (s *Service) applyApprovedDecision(ctx context.Context, event approvalapp.T
|
||||
if err := validateApprovedRefundAmount(approvedAmount, refund.RequestedRefundAmount, &order); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.preparePaymentRefundCredentials(ctx, tx, order.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
// 原路退款只登记待执行事实:退款单转入原路处理中,订单在渠道明确成功前保持已支付。
|
||||
// 客户收款信息与退回原钱包在审批通过时即完成,订单同时置为已退款。
|
||||
originalRoute := refund.Method == constants.RefundMethodOriginalRoute
|
||||
@@ -163,6 +160,10 @@ func (s *Service) applyApprovedDecision(ctx context.Context, event approvalapp.T
|
||||
if order.PaymentStatus != model.PaymentStatusPaid && order.PaymentStatus != model.PaymentStatusRefunded {
|
||||
return errors.New(errors.CodeInvalidStatus, "订单状态不允许原路退款")
|
||||
}
|
||||
// 收款商户凭证只约束原路退款;客户收款信息与钱包退款不经渠道,不受其完整性影响。
|
||||
if err := s.preparePaymentRefundCredentials(ctx, tx, order.ID); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := s.prepareChannelRefundInTx(ctx, tx, &refund, attempt); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user