wangjia
|
da8bbefe2e
|
merge: P8 订阅/recurring + 拒付 chargeback 并入(订阅生命周期/续费/取消/past_due/chargeback/事件集收口)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
# Conflicts:
# internal/model/testdb.go
# internal/provider/provider.go
# internal/router/router.go
# internal/store/order_query_test.go
# main.go
|
2026-07-10 19:43:32 +08:00 |
|
wangjia
|
4a1a431f62
|
fix(v2): stripe sessionToEvent 回填 SubscriptionRef(订阅首期激活主链路生产可用)
checkout.session.completed 的 sessionToEvent 从不读 sess.Subscription,导致真实
Stripe 路径下 PaidEvent.SubscriptionRef 恒为空,settle.go 的激活门(SubscriptionRef
!= "")恒 false,订阅创建→首付→激活链路在生产环境整体不工作。fake provider 测试
直塞 SubscriptionRef,掩盖了这个接缝。
补 sess.Subscription != nil 时回填 ID(与既有 inv.Subscription 同套路);Kind 保持
零值 EventPayment——分派门只看 SubscriptionRef,不看 Kind。新增 adapter 测试先红
后绿,验证 VerifyCallback 真实路径产出正确 SubscriptionRef。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 19:12:33 +08:00 |
|
wangjia
|
b0714ca758
|
feat(pay-v2): P8 Task6 拒付 chargeback 记录 + chargeback.received
|
2026-07-10 18:52:13 +08:00 |
|
wangjia
|
02b2fcfa41
|
fix(v2): 取消失配收敛——渠道已取消(哨兵)→本地补齐+事件,不再500
CancelSubscription 本地 active/past_due 但渠道已先行取消(dashboard 手工 /
竞态未消费的 deleted webhook)时,stripe adapter 原样透传渠道拒绝,handler 映
成 500 cancel_failed——渠道取消这一事实明明已成立。新增 provider.ErrSubAlready
Canceled 哨兵,stripe adapter 识别 resource_missing / "already been canceled"
两种真实 Stripe 错误形态并 wrap;gateway.CancelSubscription 命中哨兵后走与入
站 webhook 相同的 finalizeCanceled 本地收敛,两路对同一终态天然幂等。
同 re-review 顺手核掉同型缺口:onSubscriptionActivated 的
`!created→return nil` 在入队 subscription.created 之前短路,首次入队失败后
Stripe 重投会因 created=false 永久跳过入队——通知永久丢失。改为无论 created
与否都无条件入队,outbox 唯一键 ON CONFLICT DO NOTHING 天然幂等自愈,与
finalizeCanceled/markSubscriptionPastDue/settleRenewal 同一写法。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 18:42:20 +08:00 |
|
wangjia
|
62abdc1d65
|
feat(pay-v2): P8 Task5 订阅取消(API+入站)+ past_due 状态
|
2026-07-10 18:18:55 +08:00 |
|
wangjia
|
c677d64529
|
feat(pay-v2): P8 Task4 续费入账 invoice.paid→renewal order + subscription.renewed
|
2026-07-10 18:06:38 +08:00 |
|
wangjia
|
e26f995d7f
|
fix(v2): P4 终审波——歧义渠道错误留 processing(ErrRefundRejected 哨兵)/ 拒绝fixture签名 / 错误映射测试 / GetRefund 日志
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013nMthbVEmQquxBRKb9Fj8u
|
2026-07-10 17:58:42 +08:00 |
|
wangjia
|
83e3551609
|
feat(pay-v2): P8 Task2 PaidEvent.Kind + SubscriptionProvider + Stripe 订阅 Checkout/取消
|
2026-07-10 17:51:42 +08:00 |
|
wangjia
|
12c1a747db
|
feat(v2): Stripe adapter 落地 RefundingProvider(session→payment_intent→Refunds.New,refund_id 作幂等键)
|
2026-07-10 17:32:58 +08:00 |
|
wangjia
|
c4fc962db2
|
chore(v2): P3 终审收尾——GetReserved 移 export_test / BuildRegistry 表测试 / 坏签名负路径 / 注释更正
|
2026-07-10 15:32:10 +08:00 |
|
wangjia
|
79b9111a99
|
feat(v2): stripe adapter — Checkout Session 跳转 + webhook 验签(stripe-go/v79 pin)
|
2026-07-10 15:07:10 +08:00 |
|