wangjia
|
c677d64529
|
feat(pay-v2): P8 Task4 续费入账 invoice.paid→renewal order + subscription.renewed
|
2026-07-10 18:06:38 +08:00 |
|
wangjia
|
799d74668d
|
feat(pay-v2): P8 Task1 Subscription 模型 + 三态状态机 + store
|
2026-07-10 17:45:10 +08:00 |
|
wangjia
|
aa14204640
|
fix(v2): 超退守卫事务化 CreateRefundGuarded(锁单行+求和+插入单事务)+ sqlite DSN 补 _txlock=immediate
Task 3 计划的 RefundSum→比较→CreateRefund 两段式裸读写在并发下会超退(两个请求都读到
reserved=0、都通过、都插入)。仿 store/order.go::MarkAttemptPaid 的模式,把锁订单行
(clause.Locking FOR UPDATE,MySQL 真锁/SQLite 由 glebarez 静默丢弃)+ 求和 + 校验 + 插入
收进单个 s.db.Transaction。SQLite 侧真正的串行化靠 DSN _txlock=immediate(BEGIN IMMEDIATE
在事务开始就抢写锁)+ busy_timeout,补进 testdb.go 与 main.go 的 sqlite DSN 构造。
|
2026-07-10 17:08:25 +08:00 |
|
wangjia
|
338e28d386
|
feat(v2): RefundStore(建单/求和/条件翻转/人工待办)+ Order 退款态机(PaidAttempt/ApplyRefundToOrder)
|
2026-07-10 16:49:15 +08:00 |
|
wangjia
|
ed5ec5c894
|
feat(v2): outbox 退款感知(refund_id 进唯一键)+ 投递门禁放行退款态 + Enqueue 贯通 refundID
|
2026-07-10 16:26:32 +08:00 |
|
wangjia
|
c06f6d3a3c
|
feat(v2): gateway 经 Picker 路由选账户 + retry 换号(ExcludeAccounts);替换首个 enabled
|
2026-07-10 14:02:33 +08:00 |
|
wangjia
|
63af44bfe1
|
fix(v2): webhook 截断 UTF-8 安全 + 投递门禁查库失败落日志(与未付区分)
- MarkFailed: truncateUTF8 避免截断中点 UTF-8 rune, last_error 安全 <=255B
- notifier truncate: 同上, 投递失败消息截断 UTF-8 安全
- deliverOne: 拆分 orderPaid 错误分支 — DB 错误落日志 [webhook] 投递门禁查单失败,与"订单未付"(静默)区分
- test: MarkFailed with long Chinese string, 验证 stored last_error 为有效 UTF-8 且 <=255B
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 11:31:16 +08:00 |
|
wangjia
|
3f5e44581f
|
feat(v2): webhook v2 outbox + Notifier(event_type + HMAC 双向 + 重试兜底)
|
2026-07-10 11:25:14 +08:00 |
|
wangjia
|
31e354e31c
|
feat(v2): OrderStore 扩展 GetOrder/AttemptByProviderRef/ListByStatus/ExpirePending
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 11:01:42 +08:00 |
|
wangjia
|
af15f4736e
|
fix(v2): MarkAttemptPaid 按单scope+校验attempt命中 + OpenTestDB 唯一库名
- attempt UPDATE 加 out_trade_no 过滤并检查 RowsAffected,防止 order 已翻
paid 但 providerRef 错配导致没有对应 attempt 被标记的账本背离(未命中
时返回 error 触发事务回滚,order 保持 pending)
- 补测试覆盖 providerRef 错配场景:断言返回 error 且回滚后订单仍 pending
- OpenTestDB 改为每次调用生成唯一内存库名(atomic 计数器),避免同包多
测试共享 file::memory:?cache=shared 导致数据串扰
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
2026-07-10 08:35:22 +08:00 |
|
wangjia
|
6a53d7e008
|
feat(v2): OrderStore 建单/建尝试/幂等标付/取消/列表(条件UPDATE+RowsAffected)
|
2026-07-10 08:21:02 +08:00 |
|