fix: 退款审批通过时仅原路退款校验收款商户凭证
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:
邹进
2026-10-15 16:51:28 +09:00
parent 1d6c212d04
commit b434eda5c7
3 changed files with 11 additions and 5 deletions

View File

@@ -19,6 +19,9 @@ func (s *Service) SetPaymentMerchantRuntime(runtime *merchantpayment.RuntimeLoad
// preparePaymentRefundCredentials 在企微通过事务内装载并校验原路退款所需凭证。
//
// 仅退款方式为原路退款时调用:线上支付订单也可选客户收款信息退款(如商户号余额不足),
// 该方式不经渠道,不能因收款商户凭证不完整被阻断。
//
// 钱包支付和线下支付没有收款商户凭证,直接放行。merchant_id 为空仅表示留存期内的历史
// 线上支付,仍按 payment_config_id 读取兼容配置;绝不能按当前商户池推断历史商户。
func (s *Service) preparePaymentRefundCredentials(ctx context.Context, tx *gorm.DB, orderID uint) error {