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

How to fix it

  1. 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.
  2. Payment Links can be deactivated in the Dashboard or with the API (active: false).
  3. 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

All payments checks

Sponsor this page: get in touch.

Get new checks by email

New checks and real leak post-mortems, about once a month. No spam.