fix(billing): clean up only a checkout the provider refused #130

Sammanfogat
supernaut sammanfogade 2 incheckningar från fix/refused-checkout-state in i main 2026-10-11 09:29:27 +00:00
Ägare

Closes #129

A checkout the provider refused at create left an incomplete subscription and a pending charge for good. startCheckout inserted both before calling the provider, and its error path only cleaned up for an extension.

  • On a provider refusal at create, one transaction marks the charge failed and a new subscription canceled.
  • Only a 4xx the provider answered with ends the checkout. Timeouts, 5xx, 408 and 409 leave it pending, so a late paid webhook still activates it.
  • A live subscription being extended is left alone, as before.
  • A cleanup failure is logged and the provider error is still rethrown.
  • The webhook path for failed, canceled and expired payments is unchanged.

Tests: a refused first checkout leaves no pending charge and no incomplete subscription; a retry is accepted; timeout, 502 and 409 leave the checkout pending. 418 pass.

Existing stale rows are not swept. They need a one-off update.

Closes #129 A checkout the provider refused at create left an `incomplete` subscription and a `pending` charge for good. `startCheckout` inserted both before calling the provider, and its error path only cleaned up for an extension. - On a provider refusal at create, one transaction marks the charge `failed` and a new subscription `canceled`. - Only a 4xx the provider answered with ends the checkout. Timeouts, 5xx, 408 and 409 leave it `pending`, so a late paid webhook still activates it. - A live subscription being extended is left alone, as before. - A cleanup failure is logged and the provider error is still rethrown. - The webhook path for failed, canceled and expired payments is unchanged. Tests: a refused first checkout leaves no `pending` charge and no `incomplete` subscription; a retry is accepted; timeout, 502 and 409 leave the checkout pending. 418 pass. Existing stale rows are not swept. They need a one-off update.
supernaut lade till 2 incheckningar 2026-10-11 09:26:55 +00:00
supernaut schemalade den här ändringsförfrågan för automatisk sammanfogning när alla kontroller lyckas 2026-10-11 09:27:51 +00:00
supernaut sammanfogade incheckning ee0f196b4a till main 2026-10-11 09:29:27 +00:00
supernaut tog bort grenen fix/refused-checkout-state 2026-10-11 09:29:27 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-payment!130
Ingen beskrivning angiven.