Skip to content

fix(payments): Stripe 入账事件归属检查与隔离测试(未验收) - #713

Merged
LIghtJUNction merged 2 commits into
mainfrom
fix/bi-05-payment-credit
Oct 10, 2026
Merged

LIghtJUNction merged 2 commits into
mainfrom
fix/bi-05-payment-credit

Conversation

@LIghtJUNction

@LIghtJUNction LIghtJUNction commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

BI-05 范围

关联审计 PR #711。分支 fix/bi-05-payment-credit,起点为 main@2f4164978cf27f6e0e605b0589fbe631aef2c441。只针对当前 main 的 Go 支付业务,不以 #675/#707 的微内核作为验收证据。

提交内容

  1. 测试提交 e6a4f9bf025e4f91e294f02396589aaa8252f091:新增 apps/api-go/controller/topup_credit_isolation_test.go。使用内存 SQLite、模拟 Redis、Stripe SDK 构造的签名事件和真实 Stripe 回调/入账路径,验证异常回滚、重试、重复/并发事件、冻结报价、跨订单交易号以及金额、币种、环境、Connected Account 不匹配等情况。测试会比对订单与用户余额,并有有效回调的对照。
  2. 修复提交 619f915089f0a32d54402989ce66ae9d6138bada:在 fulfillOrder 的一次性充值路径核对 Stripe webhook 事件的 livemode 与配置的 sk_test_/sk_live_/rk_test_/rk_live_ 环境;拒绝未配置的模式及 Connect account 事件。签名验证保留在原来的 StripeWebhook。冲突错误按现有流程不入账,并保留记录供人工核对。未修改订阅分支、退款、价格换算或数据库结构。

验证状态和风险(必须阅读)

未完成应用编译及业务测试,不得宣称支付链路已验收。 当前隔离运行环境仅有 Go 1.23.2,而项目 apps/api-go/go.mod 需要 Go 1.25.1;缺少完整依赖,且无法从本地检出 GitHub 仓库。原测试交付包的新增 Go 文件已通过 gofmt 和 Go parser 语法检查;这不等于类型检查或运行成功。新修复通过 GitHub 差异检查,代码符合已有 Stripe Event 字段(Account、Livemode),未获得项目构建或真实支付证据。

后续必须在没有真实网关凭证的隔离环境执行:

cd apps/api-go
GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off go test ./model -run '^TestCompleteExternalTopUp' -count=1
GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off go test ./controller -run '^TestStripeWebhookRetriesWhenLocalSettlementCannotPersist$' -count=1
GOTOOLCHAIN=local GOPROXY=off GOSUMDB=off go test -race ./controller -run '^TestBI05Stripe' -count=1

这些是待运行命令,不是成功日志。新测试只覆盖 Stripe 合成渠道;尚未覆盖真实 Stripe/ePay/Waffo/Pancake/Creem 端到端、到账查询和正式资金流水、多进程并发或未知提交结果的恢复。模拟回调不能证明真实支付平台行为;SQLite 不能证明生产数据库事务行为。

合并授权和操作边界

最初要求“不合并”,随后仓库所有者两次明确要求合并,本 PR 据后续授权进入合并流程。合并不代表支付业务验收通过。所有本分支提交均含 [skip ci];未主动触发远程 CI、真实扣款、发送通知、部署或发布。

@LIghtJUNction LIghtJUNction changed the title test(payments): 补充 Stripe 隔离入账测试草稿(执行受阻) fix(payments): Stripe 入账事件归属检查与隔离测试(未验收) Oct 10, 2026
@LIghtJUNction
LIghtJUNction marked this pull request as ready for review October 10, 2026 17:27
Copilot AI balanced review requested due to automatic review settings October 10, 2026 17:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-10-10T17:30:31.776630Z 619f915 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@LIghtJUNction
LIghtJUNction merged commit e9a7bf5 into main Oct 10, 2026
@LIghtJUNction
LIghtJUNction deleted the fix/bi-05-payment-credit branch October 11, 2026 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants