feat(checkout): show the payment outcome on return #300

Sammanfogat
supernaut sammanfogade 1 incheckning från feat/295-checkout-outcome in i main 2026-10-06 08:56:53 +00:00
Ägare

After checkout the account page showed one notice for every outcome. It now shows the actual result, read from the billing service, never from the redirect.

  • /api/checkout sends locale (sv_SE or en_GB) and cancelUrl = <account URL>?checkout=cancelled#checkout on the same origin as returnUrl.
  • On return, checkoutOutcome reads latestCharge from subscriptionStatus: paid, pending, failed, expired or cancelled, each with its own message. Failed, expired and cancelled offer "Try again". The query slot only matters when the service reports no charge.
  • Types follow the billing contract 0.7.0: status incomplete, nullable currentPeriodEnd, optional latestCharge, renewal, paidUntil. Missing fields read as null, so an older service still works.
  • Copy in Swedish and English, checked against the content style guide.

Tests: 523 passed. New cases cover the request body, each outcome, charge over slot, old-service compatibility and incomplete.

Needs bitborg-payment 0.6.0 on a host before the outcome messages show; with an older service every return shows the previous generic notice. Version 1.20.0.

Closes #295.

After checkout the account page showed one notice for every outcome. It now shows the actual result, read from the billing service, never from the redirect. - `/api/checkout` sends `locale` (`sv_SE` or `en_GB`) and `cancelUrl` = `<account URL>?checkout=cancelled#checkout` on the same origin as `returnUrl`. - On return, `checkoutOutcome` reads `latestCharge` from `subscriptionStatus`: paid, pending, failed, expired or cancelled, each with its own message. Failed, expired and cancelled offer "Try again". The query slot only matters when the service reports no charge. - Types follow the billing contract 0.7.0: status `incomplete`, nullable `currentPeriodEnd`, optional `latestCharge`, `renewal`, `paidUntil`. Missing fields read as null, so an older service still works. - Copy in Swedish and English, checked against the content style guide. Tests: 523 passed. New cases cover the request body, each outcome, charge over slot, old-service compatibility and `incomplete`. Needs bitborg-payment 0.6.0 on a host before the outcome messages show; with an older service every return shows the previous generic notice. Version 1.20.0. Closes #295.
supernaut lade till 1 incheckning 2026-10-06 08:54:13 +00:00
feat(checkout): show the payment outcome on return
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m52s
75c3f824fd
Closes #295.
supernaut sammanfogade incheckning 0ba892d1a8 till main 2026-10-06 08:56:53 +00:00
supernaut refererade denna ändringsförfrågan från en incheckning 2026-10-06 08:56:55 +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-web!300
Ingen beskrivning angiven.