feat(account): withdrawal function and start-at-once consent #273

Sammanfogat
supernaut sammanfogade 7 incheckningar från feat/withdrawal-function in i main 2026-09-30 21:08:24 +00:00
Ägare

What

Two consumer-law pieces paid checkout needs (2 kap. 10 a § and 15 § lagen 2005:59). Off until BILLING_API_URL and BILLING_API_TOKEN are set, so nothing changes in production on merge.

  • Withdrawal function on the account page ("Right of withdrawal" / "Ångerrätt"). Shown while the billing service reports an open withdrawalDeadline, with the deadline in Swedish time.
    • The request is stored in withdrawal_requests before the billing service is called, so the consumer's exercise of the right is never lost.
    • Transient failures (network, 5xx, payments disabled) are retried with the original request time, for up to 7 days. Final answers (window closed, nothing to withdraw) are recorded and not retried.
    • An email receipt with date and time goes out either way, worded by refund status (on its way, paid, or to be handled).
  • Consent to start at once: a required checkbox component and beginCheckout, which stores the consent with a timestamp in checkout_consents and passes it to checkout. There is no checkout UI yet, so these are the pieces checkout will call.
  • A small typed fetch client for the billing service. Errors map by error.data.reason, never message text.

Version 1.13.0.

Migrations

0007 (two new tables), 0008 and 0009 (one nullable column each). All additive. Not applied anywhere.

Verified

Pre-push: prettier, eslint, stylelint, markdownlint, lang-check, astro check (0 errors), drizzle-kit check, gitleaks, audit, 400 unit tests, build and e2e all pass.

Not done: a manual look at the account page with the feature on. That needs a running billing service.

Before release

  • A read of the Swedish and English consent, withdrawal and receipt wording.
  • Wire checkout (#145 / #149) to beginCheckout.

Refs #259. It closes once a test-mode withdrawal reaches the billing service end to end.

## What Two consumer-law pieces paid checkout needs (2 kap. 10 a § and 15 § lagen 2005:59). Off until `BILLING_API_URL` and `BILLING_API_TOKEN` are set, so nothing changes in production on merge. - **Withdrawal function** on the account page ("Right of withdrawal" / "Ångerrätt"). Shown while the billing service reports an open `withdrawalDeadline`, with the deadline in Swedish time. - The request is stored in `withdrawal_requests` before the billing service is called, so the consumer's exercise of the right is never lost. - Transient failures (network, 5xx, payments disabled) are retried with the original request time, for up to 7 days. Final answers (window closed, nothing to withdraw) are recorded and not retried. - An email receipt with date and time goes out either way, worded by refund status (on its way, paid, or to be handled). - **Consent to start at once:** a required checkbox component and `beginCheckout`, which stores the consent with a timestamp in `checkout_consents` and passes it to checkout. There is no checkout UI yet, so these are the pieces checkout will call. - A small typed fetch client for the billing service. Errors map by `error.data.reason`, never message text. Version 1.13.0. ## Migrations `0007` (two new tables), `0008` and `0009` (one nullable column each). All additive. Not applied anywhere. ## Verified Pre-push: prettier, eslint, stylelint, markdownlint, lang-check, `astro check` (0 errors), drizzle-kit check, gitleaks, audit, 400 unit tests, build and e2e all pass. Not done: a manual look at the account page with the feature on. That needs a running billing service. ## Before release - A read of the Swedish and English consent, withdrawal and receipt wording. - Wire checkout (#145 / #149) to `beginCheckout`. Refs #259. It closes once a test-mode withdrawal reaches the billing service end to end.
supernaut lade till 6 incheckningar 2026-09-30 18:32:32 +00:00
supernaut lade till 1 incheckning 2026-09-30 19:23:31 +00:00
feat(checkout): send the session's name and email to billing
Alla kontroller lyckades
ci / ci (pull_request) Successful in 1m27s
6020a48c80
supernaut sammanfogade incheckning f8e7743284 till main 2026-09-30 21:08:24 +00:00
supernaut tog bort grenen feat/withdrawal-function 2026-09-30 21:08:24 +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!273
Ingen beskrivning angiven.