testing · 2025-04-07 · 5 min read
Sandbox vs. live mode: the switch that bites on launch day
Test numbers work only with test API keys; real cards only with live keys. Mixing them is the single most common first-launch failure — here is the checklist that prevents it.

Every provider separates test and live environments by API key — Stripe with sk_test_ / sk_live_ prefixes, PayPal with separate sandbox and live apps, Braintree with separate merchant IDs. The two worlds never meet: a test card against a live key is declined; a real card against a test key is rejected or silently ignored.
Symptoms of a mixed-up environment
- 'Your card was declined' for every customer on launch morning — test keys in production.
- Orders marked paid but no money arriving — live front end, test back end.
- Webhooks never firing — endpoint registered in the wrong mode.
- Dashboard shows the payment but in the other mode's view.
Pre-launch checklist
- Swap keys in configuration or secrets, never in code, and make the live key unavailable in CI.
- Register webhook endpoints in live mode and verify signatures with the live signing secret.
- Run one real low-value transaction with your own card and refund it.
- Confirm the publishable key in the browser bundle is the live one — it is easy to ship a cached test build.
- Keep a staging environment that uses test keys permanently so you can keep using the sandbox numbers.
Stripe's test mode documentation and the PayPal sandbox guide describe each provider's specifics.
Validation on this site is mode-agnostic: it only inspects format. Whether a number is accepted is decided entirely by the gateway and the issuer — see the limits section.

Keywords: sandbox mode, live mode, test API keys, payment go-live checklist, webhooks, Stripe test mode, PayPal sandbox
Frequently asked questions
Why does 4242 4242 4242 4242 get declined on my live site?
Because test numbers only work with test API keys. In live mode the network treats them as non-existent cards.
Can I use my real card to test a live integration?
Yes — one low-value charge followed by a refund is the standard final check before launch.