The double-charge email
A provider resends a webhook, which is normal. Your code applies it twice. Now a customer's access or credit balance is wrong. Here, a repeated event changes nothing.
Checkout, upgrades en facturen werken al. Niemand betaalt twee keer door een retry.
Checkout, upgrades en facturen werken al. Niemand betaalt twee keer door een retry.
Productvoorbeeld
Dit is hetzelfde visuele component als in de ingelogde applicatie, met voorspelbare voorbeelddata.
See the no-subscription state and the implemented upgrade choices.
Inerte voorbeelddata · geen netwerktoegang
Voorbeeld gereed
Zonder een gedeelde basis bouwt elk team deze randgevallen opnieuw — en anders.
A provider resends a webhook, which is normal. Your code applies it twice. Now a customer's access or credit balance is wrong. Here, a repeated event changes nothing.
A customer cancels. A slow update message arrives late and flips them back to active. They get billed for a plan they ended. This kit checks event timestamps and throws the stale message away.
The pricing page says one thing. Checkout charges another. The server enforces a third. They drift apart slowly, and a customer notices before you do. Here it's all one file.
Kernpunten
Pricing, checkout, provider IDs, access, credits, and usage all read the same typed definition.
Providers resend events by design. Each one applies exactly once, so a repeat settles to the same result.
If a late message arrives after a newer one, the server skips it. A cancellation can't get undone by a stale update.
Het mechanisme van begin tot eind, zoals het in de repository is geïmplementeerd.
One product catalog
You define modes, offers, provider IDs, and fulfillment once. Pricing, checkout, and server-side access read from that same definition.
The server opens checkout
Only an organization admin can start hosted checkout. Stable idempotency keys prevent retried clicks from creating duplicate sessions.
Every provider message is checked
The active webhook route verifies a provider signature or, for Mollie classic payment webhooks, retrieves the referenced entity with the server API key. Fake, malformed, or tenant-unbound messages cannot fulfill anything.
State moves forward, once
Each event applies inside a locked database transaction, exactly one time. Older events are skipped, so your billing state only ever moves forward.
Technische garanties
Achter de schermen houden autorisatie, tenantgrenzen en foutafhandeling één duidelijke eigenaar. Zo blijft de snelle ervaring voor gebruikers gekoppeld aan veilig herstel als het misgaat.
De grens hierboven is geen claim maar code. Deze bestanden dragen het contract:
src/features/billing/server.tssrc/features/billing/providerssrc/features/billing/jobs.tsconfig/billing.tsDeze functies delen contracten en grenzen met deze pagina.
De documentatie beschrijft dezelfde contracten die deze pagina demonstreert.