Test Mode
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 |
---|---|---|---|
Visa | 4242 4242 4242 4242 | Any 3 digits | Any future date |
Visa (debit) | 4000 0566 5566 5556 | Any 3 digits | Any future date |
Mastercard | 5555 5555 5555 4444 | Any 3 digits | Any future date |
Mastercard (debit) | 5200 8282 8282 8210 | Any 3 digits | Any future date |
American Express | 3782 822463 10005 | Any 4 digits | Any future date |
Discover | 6011 1111 1111 1117 | Any 3 digits | Any future date |
Discover (debit) | 6011 9811 1111 1113 | Any 3 digits | Any future date |
JCB | 3566 0020 2036 0505 | Any 3 digits | Any future date |
Decline Payments
Description | Number | Error Message |
---|---|---|
Generic decline | 4000 0000 0000 0002 | Your HSA/FSA card was declined. |
Insufficient funds decline | 4000 0000 0000 9995 | Your card has insufficient funds. |
Incorrect CVC decline | 4000 0000 0000 0127 | Your HSA/FSA card was declined due to an incorrect CVC. |
Incorrect number decline | 4242 4242 4242 4241 | Your card number is invalid. |
Exceeding velocity limit decline | 4000 0000 0000 6975 | Your card was declined for making repeated attempts too frequently. |
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