fix: 排队激活未评估停复机、孤儿套餐重复激活与微信查单订单不存在反复重查
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 9m26s

- 排队激活与首次实名激活任务的处理器注入停复机服务:原来传 nil,激活后不重新评估停复机,付款或实名后要等下一轮轮询才复机(生产同样存在)
- 孤儿套餐扫描跳过载体未实名的"实名即生效"套餐:激活服务会直接跳过,原来每 10 秒重复提交一次激活任务
- 微信 v2 查单返回 ORDERNOTEXIST 时按"渠道无此订单"处理:代理充值支付单过期后关闭,不再当作结果未知每几分钟重查

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
邹进
2026-10-27 11:07:17 +09:00
parent c9e5d65590
commit d2b0d2f534
6 changed files with 47 additions and 1 deletions

View File

@@ -34,6 +34,8 @@ const (
OnlinePaymentStateClosed = "closed"
// OnlinePaymentStateUnknown 表示渠道状态暂时无法确定。
OnlinePaymentStateUnknown = "unknown"
// OnlinePaymentStateNotFound 表示渠道明确没有这笔订单;恢复任务在支付单过期后按关闭处理。
OnlinePaymentStateNotFound = "not_found"
)
// OnlinePaymentRequest 描述生成支付链接与主动查单所需的最小事实。

View File

@@ -139,6 +139,12 @@ func (s *RecoverOnlinePaymentService) queryPayment(ctx context.Context, adapter
return err
case OnlinePaymentStateClosed:
return s.closePending(ctx, payment, recharge)
case OnlinePaymentStateNotFound:
// 渠道没有这笔订单:过期后已不可能再支付,按关闭处理;未过期时可能尚未同步到渠道,继续等待。
if payment.ExpireAt != nil && time.Now().After(*payment.ExpireAt) {
return s.closePending(ctx, payment, recharge)
}
return nil
default:
return nil
}