Sandbox / Test Mode
A parallel copy of a service that behaves like the real thing but touches nothing real: fake charges, fake emails, fake shipments.
See it
What it is
A sandbox is a parallel copy of a third-party service that speaks the same API but touches nothing real. It aims to approximate the production contract (the same endpoints, the same payload shapes, the same webhook events) except the cards never charge, the emails never send, and the packages never ship. How faithfully it copies varies by vendor: some sandboxes live on a different host, leave whole features out, or skip behavior you assumed was part of the deal. Usually you switch into it by swapping one credential: Stripe gives you 'sk_test_' keys, Twilio gives you test credentials, PayPal and Shopify give you whole sandbox accounts.
Reach for it during the entire build, and keep reaching for it after launch: staging, CI, and every local machine should point at test mode so nobody refunds a real customer while debugging. Sandboxes usually ship magic values that force outcomes on demand: card 4242 4242 4242 4242 always succeeds, 4000 0000 0000 0002 always declines. That is how you test the sad paths you cannot trigger with real money.
Gotcha: sandbox is never a perfect twin. Rate limits are looser, data resets without warning, fraud and risk rules are switched off, and some endpoints simply return canned responses. The bugs that reach production are the ones living in that gap, so treat your first live transaction as a real test with real eyes on it.
Ask AI for it
Wire this integration so test mode and live mode are a one-variable switch, never a code change. Read the API base URL and the API key from environment variables, default every non-production environment to the provider's sandbox credentials, and throw a startup error if live keys are ever loaded outside production. Add a small banner or log line showing which mode is active, and include a seed script that exercises the provider's magic test values for success, decline, and timeout so all three paths are covered before launch.