Kindly EditDocumentationTry the editor

Sandbox billing integration

How checkout events are verified and reconciled into license entitlement in the inspected website source.

Current source boundary#

The inspected website source explicitly gates checkout, billing-portal sessions, and webhook handling to Stripe test mode. This reference describes that implementation. It does not claim that live payments are enabled.

Checkout#

The checkout endpoint accepts a configured plan identifier and constructs a subscription checkout using the corresponding server-side price ID. It applies origin and rate checks. The browser does not choose an arbitrary price or site entitlement.

Webhook verification#

The webhook reads a bounded raw body and verifies the Stripe signature with a timestamp tolerance. It validates the event environment and relevant identifiers before using the payload. Unrelated event types can be acknowledged without changing licenses.

Reconciliation#

A per-subscription database lease prevents competing handlers from reconciling the same subscription simultaneously. After acquiring the lease, the handler fetches current subscription and checkout information from Stripe. This prevents an older event snapshot from overwriting current subscription state.

Provisioning requires a verified completed checkout, the expected subscription and customer, a recognized test price, one line item with the expected quantity, and a valid customer email. A later billing event can recover provisioning only through that verified checkout relationship.

Entitlement and idempotency#

The entitlement calculation checks the configured price, billing period, subscription status, and settled invoice state. Updates preserve an administrator suspension. Processed event IDs prevent duplicate application.

Database writes run in a transactional batch with an owner check against the lease. A handler whose lease expired cannot commit after a replacement owner took over. The lease is released in a finally block. Busy or lost-lease conditions request a retry instead of pretending reconciliation succeeded.

Operational verification#

Test duplicate and out-of-order events, delayed payment, failed payment, cancellation, unsupported prices, expired leases, and administrator suspension in the sandbox. A code rollback does not undo license records already written by a webhook.

About this page

Documents Kindly Edit 0.9.16. Source: website/src/stripe.js, website/src/index.js. Theme choices and account permissions can change which controls appear.

Type a word or phrase to search the full documentation.