ShipSafe · Payments
Payments Preflight
15 checks to run before you take money in an app built with Cursor, Claude Code, Lovable or similar. Each page says how to check, how to fix, and gives a prompt for your AI coding tool. Sources are Stripe's docs.
- Verify every webhook signatureCheck the Stripe-Signature header against the raw body and your whsec_ secret.
- Handle webhook retries and duplicate eventsStripe retries and can resend an event, so store processed event ids.
- Handle events that arrive out of orderEvents can arrive in any order, so fetch the current object from the API.
- Keep test and live keys separatesk_live_ keys belong only in production env vars; webhook secrets differ per mode.
- Use restricted API keys where you canGive scripts, jobs, AI agents and third-party tools rk_ keys with limited permissions.
- Never trust prices or amounts from the clientCreate sessions on the server from your own Price IDs, never browser amounts.
- Have a kill switch for checkoutA flag that stops new checkout sessions, plus Payment Links you can deactivate.
- Handle failed payments and dunningListen for invoice.payment_failed, enable Smart Retries, decide what past_due keeps.
- Handle refunds and disputesRemove access when money goes back and see disputes before the response deadline.
- Keep subscription state in sync with StripeSync customer.subscription.* events into one table and read access only from it.
- Let customers manage billing safelyCreate portal sessions on the server, only for the signed-in user's customer id.
- Get tax and receipts basics rightTurn on email receipts and decide on sales tax and VAT before launch.
- Rate limit checkout session creationCap sessions per user and IP to slow card testing and protect API limits.
- Log payments without card data or secretsCollect cards with Checkout or Elements and log Stripe ids, not payloads or keys.
- Test with the Stripe CLI, test cards and test clocksUse stripe listen, stripe trigger, decline and 3D Secure test cards, and test clocks.
Ticks stay in this browser. Not affiliated with Stripe. Written for Stripe, most points apply to any payment provider.
Also see the pre-deploy security checklist: secrets, auth, abuse and deploy settings.
Sponsor this page: get in touch.