Payments Preflight · Check 7 of 15
Have a kill switch for checkout
Put new checkout sessions behind a flag you can switch off without a deploy, and know how to deactivate Payment Links and disable webhook endpoints.
What it is
A single setting that stops your app from creating new Checkout Sessions, so you can pause payments during a bug, an abuse wave or a pricing mistake.
Why it matters
If a price is wrong or checkout is being abused, waiting for a code fix and a deploy lets the problem keep running.
How to check
- Ask: if checkout broke at 3am, how would you stop new payments in under five minutes?
- List every way a customer can pay: your checkout route, Payment Links, pricing tables.
How to fix it
- Read a flag (env var, config table or feature flag service) at the top of your checkout route and return a friendly message when it is off.
- Payment Links can be deactivated in the Dashboard or with the API (
active: false). - A webhook endpoint can be disabled in the Dashboard or via the API if your handler is misbehaving. Stripe stops retrying events for a disabled endpoint, so re-enable it and resend missed events from the Dashboard (possible for up to 15 days after an event was created) or with
stripe events resend.
if (process.env.CHECKOUT_ENABLED !== "true") {
return Response.json({ error: "Checkout is paused. Try again soon." }, { status: 503 });
}Prompt for your AI coding tool
Paste into Cursor, Claude Code, Lovable or similar. Review the diff before you accept it.
Add a checkout kill switch. At the top of every route that creates a Stripe Checkout Session or PaymentIntent, read a CHECKOUT_ENABLED flag and return a 503 with a short message if it is not true. Show the paused state in the UI. List any Stripe Payment Links or pricing tables the app uses so I can deactivate them separately.
Sources
- Update a Payment Link (active) Stripe docs
- Update a webhook endpoint (disabled) Stripe docs
- Webhooks: automatic retries Stripe docs
Sponsor this page: get in touch.