feat(signup): flag-gated paid account option #282
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
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-web!282
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "feat/149-paid-signup"
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
A flag-gated paid account option at sign-up.
PAYMENTS_ENABLEDofferedAccountTypes()insrc/lib/signup-access.tsmakes the decision. The form and the API both read it, so paid and trial never render together.paid(status=input) when it is not offered. A forgedtrialwith payments on falls back to a participant account."paid"joinsPAYING_ACCOUNT_TYPES, so the country of residence is collected again for paid only. The country select shows, and is required, only while the paid option is chosen.status=paid.country) before anything is provisioned, with a message in both languages pointing at the participant account. Participant and trial sign-ups are unchanged.Hand-off
Checkout needs a signed-in session. A new user has none until they set a credential. So a paid sign-up:
trial: false, no paid group);/accountand pays through the existing checkout.The paid tier comes only from the billing webhook after payment. Sign-up never grants it. A paid sign-up lands on
status=paid, which tells the user to sign in and pay, and links to the account page./welcomelinks to the account page while checkout is available.Deploying
Production is unchanged by this PR. Turning paid sign-up on needs
PAYMENTS_ENABLED=true(plus the billing settings) in the web container. The bitborg-infra templateroles/web/templates/bitborg-web.container.j2sets none of these today.How tested
offeredAccountTypes().filter(requiresCountry)is["paid"]), the API refusing paid when payments are off or checkout is unconfigured, the Sweden-only paid check (checkoutSupports()), no paid grant at sign-up, country recorded for paid and NULL otherwise,paidstatus maps to step 2. The country tests now use the realrequiresCountryinstead of a mock.astro.config.mjs, which reads local dev certificates. Rendering was checked by hand on the built server: payments off renders trial + participant; on with billing renders paid + participant + country select; on without billing renders participant only.status=paid.countryandstatus=ineligiblerender with paid checked and the country select visible and enabled.pnpm test: 503 passed, 3 skipped.pnpm lint: clean.pnpm check: 0 errors, 0 warnings, 18 hints.pnpm build: ok.pnpm lang-check: clean.Open questions
PAYMENTS_ENABLED=truebut no billing settings, only the participant account is offered. Is that the wanted fallback?/welcomeshows the payment link to anyone while checkout is available, and the set-up email does not mention payment.Refs #149
Visa kommandoradsinstruktioner
Manuell sammanfogningshjälp
Använd detta sammanfogningsmeddelande när sammanfogningen slutförs manuellt.
Checka ut
Checka ut en ny gren från din projektkatalog och testa ändringarna.