Test your integration
Simulate subscription and charges to test your integration.
To confirm that your integration works correctly, simulate subscriptions and charges without moving any money using special values in test mode.
Test special values let you simulate several scenarios:
- Successful subscriptions and charges
- Subscriptions errors due to invalid data or failed user authorization
- Failed charges
Any time you work with a test account, use test API Keys in all API calls.
Available MFA types
These are the different MFA that we have available within test mode:
- Security device: electronic device that banks give their clients to authorize transactions. They generally show a number that changes after some time.
- Mobile application: banks offer to authorize transactions through their mobile apps. In this case, the user must authorize the transaction from their smartphone and we will detect that the transaction was authorized automatically.
- SMS: the bank sends a code (generally a numeric code) to the user's phone so that it can be used to authorize the transaction
- Coordinate card: card that banks give their clients with a table with numbers. The user must insert the numbers located at the coordinates asked by the bank. You can read more about coordinate cards here.
Simulate subscriptions
Fintoc provides test special values only for Chile as it's the only country supported by this product. With Subscription test mode, you can test every authorization flow that your user might follow.
Chile 🇨🇱
In Chile, a subscription has two steps:
- The user logs in to their bank account.
- The user authorizes the subscription.
Fintoc provides test special values for each one of those steps.
Test credentials
You can use the following test credentials to log in to a bank account.
Username | Password |
---|---|
41614850-3 | jonsnow |
40427672-7 | jonsnow |
41579263-8 | jonsnow |
MFA to authorize the subscription
To choose which authorization method to use while in test mode to confirm the subscription, you need to select a specific origin bank account number during the subscription flow. The test mode environment will always show the same accounts.
Here's a list of the test mode bank account numbers and which type of MFA corresponds to all of them, along with the correct code to enter.
Account number | Type of MFA | Correct code |
---|---|---|
813990168 | Security device | 000000 |
422159212 | Mobile Application - Success | N/A |
5233137377 | Mobile Application - Failure | N/A |
170086177 | SMS | 0000 |
746326042 | Coordinate Card | ['00', '00', '00'] |
default | Coordinate Card | ['00', '00', '00'] |
Simulate charges
To simulate a successful or failed charge, you can use the amount attribute:
- Amounts greater than or equal to
500
result in asucceeded
charge. - Amounts less than 500
result
in afailed
charge.
In test mode, both scenarios have immediate webhook notifications. Before making a test charge, you need to create a test subscription.
Example - Succeeded
curl --request POST \
--url https://api.fintoc.com/v1/charges \
--header 'Accept: application/json' \
--header 'Authorization: sk_test_9c8dr3ryBTx1VcJzuDgpm4H' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "clp",
"subscription_id": "sub_123ad123",
"amount": 500
}
'
{
"id": "ch_e6dGMaB5UVy2QV3j",
"failure_code": null,
"created_at": "2022-07-15T19:09:51Z",
"object": "charge",
"status": "pending",
"amount": 509,
"currency": "CLP",
"metadata": {},
"subscription_id": "sub_gJYEapRyUg07yvz3"
}
Example - Failed
curl --request POST \
--url https://api.fintoc.com/v1/charges \
--header 'Accept: application/json' \
--header 'Authorization: sk_test_9c8dr3ryBTx1VcJzuDgpm4H' \
--header 'Content-Type: application/json' \
--data '
{
"currency": "clp",
"subscription_id": "sub_123ad123",
"amount": 499
}
'
{
"id": "ch_e6dGMaB5UVy2QV3j",
"failure_code": null,
"created_at": "2022-07-15T19:09:51Z",
"object": "charge",
"status": "pending",
"amount": 50,
"currency": "CLP",
"metadata": {},
"subscription_id": "sub_gJYEapRyUg07yvz3"
}
Test webhooks
To test webhooks, you have two options:
- Perform actions in test mode that send legitimate events to your endpoint. For instance, to trigger the
charge.succeeded
event, you can use a test value that produces a successful charge. - Trigger test events from the Dashboard
Updated 5 months ago