fix(billing): buy again after the provider stops a subscription; report the current card #176
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!176
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "fix/rebuy-after-stop"
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?
Rebuy after the provider stops a subscription (#156)
A past due subscription the provider has cancelled or suspended will never renew. Checkout used to refuse it with
already_subscribeduntil the grace ended.past_due, auto-renewing, not cancelled by the customer, and the provider reports itcanceledorsuspended. Apast_dueone the provider still retries is refused, so a retry and a new purchase cannot both charge.canceled, no grace, provider subscription cancelled, mandate queued for revoke unless the new subscription shares it. No revoke of access: the grant for the new subscription keeps the tier.Withdrawal: the 14-day window and the
requested_before_purchasecheck now run from the contract time (the payment, or the period start if earlier), also in the statuswithdrawalDeadline. The refund arithmetic still uses the period start, so nothing used means a full refund. A withdrawal of a rebuy that has not started revokes nothing and does not cut the old paid days: the new subscription stays live with its end set to the old period end, and the sweep revokes then. The provider subscription is cancelled at once.Card on the status
subscriptionStatusnow reportscard(brand, last four digits) for any live subscription, past due included, and null for a one-time payment. It follows a card replacement. The field is optional in the contract, so the current portal keeps working. Contract 0.14.0.Tests
17 new tests in
billing.test.tsand 4 in the contract tests: refusal while retrying, acceptance forcanceledandsuspended, continuity before and inside the grace, shared and separate mandate, replay and reconcile, both race orders plus a concurrent run, a withdrawal of an unstarted rebuy, no revoke when the old grace ends, and thecardcases.Version 0.15.0.