Stripe’s test mode allows you to test your integration without making actual charges or payments. Test mode is a testing environment that simulates creating real objects without the risk of affecting real transactions or moving actual money.
In test mode, you can charge test credit cards as well as create test products and prices. You can also use test mode to simulate transactions to make sure that your integration works correctly. This feature helps to identify any bugs or errors in your Stripe implementation before you go live with actual payments.
After you create a Stripe account, you can find a set of test API keys in the Stripe Dashboard. You can use these API keys to create and retrieve simulated data by making requests to the Stripe API. To start accepting real payments, you need to activate your account, toggle off test mode, and use the live API keys in your integration.
Impact on live mode
In the Dashboard, changing most settings in test mode also changes them in live mode. For example, updating subscription reminders affects real customer subscriptions, not test subscriptions. Assume any changes will affect live mode settings, unless you see an orange test data banner.
Test mode versus live mode
All Stripe API requests occur in either test mode or live mode. API objects in one mode aren’t accessible to the other. For instance, a test-mode product object can’t be part of a live-mode payment.
|Type||When to use||Objects||How to use||Considerations|
|test mode||Use test mode, and its associated test API keys, as you build your integration. In test mode, card networks and payment providers don’t process payments.||API calls return simulated objects. For example, you can retrieve and use test ||Use test credit cards and accounts. You can’t accept real payment methods or work with real accounts.||Identity doesn’t perform any verification checks. Also, Connect account objects don’t return sensitive fields.|
|live mode||Use live mode, and its associated live API keys, when you’re ready to launch your integration and accept real money. In live mode, card networks and payment providers do process payments.||API calls return real objects. For example, you can retrieve and use real ||Accept real credit cards and work with customer accounts. You can accept actual payment authorizations, charges, and captures for credit cards and accounts.||Disputes have a more nuanced flow and a simpler testing process. Also, some payment methods have a more nuanced flow and require more steps.|
The Test mode toggle in the Dashboard doesn’t affect your integration code. Your test and live mode API keys are what ultimately affect the behavior of your code.
Test card numbers
Stripe provides a set of test card numbers that you can use to simulate various payment scenarios. You can use these test card numbers to create simulated payments in test mode without processing actual payments or charges.
When you use test card numbers, you can enter any expiration date in the future and any three-digit CVC code to simulate a successful payment. If you want to simulate a failed payment, you can use specific test card numbers and CVC codes provided by Stripe.
The test card numbers are only valid in test mode and shouldn’t be used for real payments.
Delete test data
To delete all of your test data from your Stripe account, complete the following steps:
- Log in to the Dashboard using your existing Stripe account.
- While in test mode, click Developers and scroll down to the bottom of the Overview tab.
- Click Delete all test data… The ensuing dialog gives you a list of all of your existing test data objects.
- Click Start deletion to initiate the deletion process. You can’t undo the deletion of your test data.
Test mode is temporarily unusable while the deletion process occurs.