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:

  1. The user logs in to their bank account.
  2. 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.

UsernamePassword
41614850-3jonsnow
40427672-7jonsnow
41579263-8jonsnow

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 numberType of MFACorrect code
813990168Security device000000
422159212Mobile Application - SuccessN/A
5233137377Mobile Application - FailureN/A
170086177SMS0000
746326042Coordinate Card['00', '00', '00']
defaultCoordinate 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 a succeeded charge.
  • Amounts less than 500 result in a failed 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:

  1. 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.
  2. Trigger test events from the Dashboard