Test Mode
Flex’s test mode allows you to test your integration without making real charges or payments.
Flex’s test mode allows you to test your integration without making real charges or payments. This testing environment simulates the creation of real products without risking actual transactions or moving real money.
Test mode and use cases
In test mode, you can process test credit card transactions, create test products and prices, and generate test payment links. You can also use test mode to simulate transactions, ensuring that your integration functions correctly. This feature helps identify any bugs or errors in your Flex implementation before you go live with actual payments.
In the Flex dashboard, you can create test API keys by navigating to the Developers tab, toggling on test mode in the upper right corner, and then creating an API key. These API keys allow you to create and retrieve simulated data by making requests to the Flex API. To start accepting real payments, you need to switch off test mode and use the live API keys in your integration.
Test mode vs. production mode
All Flex API requests occur in either test mode or production mode. API objects in one mode aren’t accessible from the other. For example, a product created in test mode can’t be used in a production transaction.
Test cards
Flex provides a set of test card numbers you can use to simulate various payment scenarios. These test card numbers allow you to create simulated payments in test mode without processing actual payments or charges.
When using test card numbers, you can enter any expiration date in the future and any three-digit CVC code to simulate a successful payment. To simulate a failed payment, specific test card numbers provided by Flex can be used.
Test card numbers are only valid in test mode. Do not use them for real payments.
Test cards by brand
Description | Number | CVC | Expiration |
---|
Decline payments
Description | Number | Error Message |
---|
Invalid data
To simulate errors caused by invalid data, simply enter incorrect details. You don’t need a specific test card for this; any incorrect information will trigger an error. For example:
Invalid expiration month: Enter a non-existent month, such as 13.
Invalid expiration year: Use a year that is more than 50 years in the past, such as 99.
Invalid CVC: Enter a two-digit code, like 88.
Invalid ZIP: Enter a four-digit zip code, like 1234.