Commit Graph

6 Commits

Author SHA1 Message Date
架构师 281522e053 修复(#136): EPay notify 静默失败硬化 + 回写 trade_no
- 签名校验失败时返回 error(保留 Debug 旁路),handler 回非 200,触发 EPay 重试
- FindOrder 失败保持 error 返回;只保留 status=5 Finished 的幂等 return nil
- 回写 req.TradeNo 到 order.trade_no,便于事后用网关流水反查订单
- TradeStatus != TRADE_SUCCESS 路径降级为 INFO + metric 名 epay_notify_trade_not_success
- 抽离 evaluateEPayNotify 纯决策函数,单测覆盖 4 个分支 + sqlmock 验证 trade_no 写路径

修复对应 HIF-135 RCA 的根因之一:签名失败时回 200 success 让 EPay 不再重试,
订单卡在 status=1,15 分钟后被 DeferCloseOrder 错关。

仅改 internal/logic/notify/ePayNotifyLogic.go 及其单测。

Co-authored-by: multica-agent <github@multica.ai>
2026-06-01 03:02:33 -07:00
shanshanzhong147 ab38cd4943 x
Build docker and publish / build (20.15.1) (push) Failing after 4m44s
2026-04-26 21:12:22 -07:00
EUForest 5f55b1242e fix: resolve order queue loss issue with retry mechanism and idempotency
- Fix task error handling: return actual errors instead of nil to enable retry
- Add idempotency check: skip processing for already finished orders
- Extend temp order cache: increase from 15 minutes to 24 hours
- Configure retry policy: add MaxRetry(5) for all payment callbacks (Epay, Alipay, Stripe)

This fixes the critical issue where paid orders were being lost due to:
1. Failed tasks being marked as successful and deleted from queue
2. Temporary order info expiring before queue processing
3. No retry mechanism for transient failures

Changes:
- queue/logic/order/activateOrderLogic.go: Fix error returns and add idempotency
- internal/logic/public/portal/purchaseLogic.go: Extend cache to 24 hours
- internal/logic/notify/*NotifyLogic.go: Add retry configuration
2026-01-12 18:30:42 +08:00
Ember Moth 8b48286365 add payment type field (alipay/wxpay) to EPay config 2025-10-15 23:20:33 +09:00
Chang lue Tsen 34c09c4618 refactor: update import paths from ppanel-server to server 2025-04-25 15:09:31 +09:00
Chang lue Tsen 8addcc584b init: 1.0.0 2025-04-25 12:08:29 +09:00