fix(billing): report a failed checkout for a returning customer #152
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-payment!152
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/143-failed-checkout-returning"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
What changed
subscriptionStatusnow looks at the newest subscription of any status first. If it isincompleteand its latest charge isfailed,canceledorexpired, it reports that. Otherwise it falls back tolatestSubscription, as before.A running (
activeorpast_due) subscription always wins over a newer incomplete checkout. The extra query only runs when the newest row isincomplete.A returning customer whose earlier subscription was
cancelednow sees the failed checkout and the retry button.Tests
canceledsubscription, new checkout that expires. It fails without the fix.pnpm lint,pnpm typecheckandpnpm testpass, withTEST_DATABASE_URLset (439 tests).Closes #143
c425b3a5f4aa79d3f739aa79d3f739a78765eadd