Test payments in sandbox
Resources for payments testing including collections, sandbox environment and mock providers.
See our GitHub page for libraries and SDKs to help you integrate the Payments API v3.
Collections
Our collections are sets of preconfigured requests that help you to test API requests as quickly as possible. For Payments, we use the Insomnia REST API client.
If you have Insomnia installed, download and install the TrueLayer collection.
The TrueLayer Insomnia plugin simplifies the process of signing your requests.
Sandbox
To enable the sandbox environment in Console, ensure that the Live toggle in the top-right corner is toggled off (it will be greyed out).
While live is toggled off, any changes you make in Console apply to sandbox, but not the live environment.
To test your API requests in the sandbox or live environments, use these base URLs:
Sandbox | Live |
---|---|
https://api.truelayer-sandbox.com/ | https://api.truelayer.com/ |
To learn how to create test payments in our sandbox environment through Insomnia, read our quickstart guide.
Test redirects with the mock bank
Several of our sandbox providers have redirect in their name. If you use these in a test payment, you can use the mock bank to test different payment outcomes.
To make the relevant providers visible during authorisation ensure that:
provider_selection.type
is set touser_selected
.provider_selection.filter.countries
is either empty or filled with 2-character country codes such asGB
,IE
orDE
.currency
is set appropriately for the the country codes you specified in the filter.
When you initiate a payment using one of these providers, we return a URI that redirects your user to our mock provider authorisation page.
On the authorisation prompt page, different actions lead to different outcomes for the payment:
Outcome | Action |
---|---|
Execution | Enter username test_executed |
Auth failure | Enter username test_authorisation_failed |
Execution rejection | Enter username test_execution_rejected |
Cancellation | Click cancel button |
Using test_executed
or test_execution_rejected
enables the Execution delay selection, where you can select from different timings, from no delay to one day.
Using test_executed
enables the Settlement delay selection, where you can select from different timings, from no delay up to one day.
When you log in with one of the previous usernames, the mock provider presents the account selection page.
When you specify remitter account details in the payment_method.provider_selection.remitter
parameter when you create a payment, only the specified account can be selected on this screen.
Sandbox payment limit
You cannot make a payment with an amount_in_minor exceeding
5000000
to a merchant account in the sandbox environment..
Sandbox providers
TrueLayer provides sandbox providers for many countries . You can use these to test your integration, regardless of whether you integrate with our web UI, mobile UI or build your own UI.
The table below lists the different sandbox providers available with some additional information such as:
- Sandbox
provider_id
: The ID you need to use for provider selection to select this provider and test with it. - Sandbox provider
display_name
: A readable name for the provider that displays during the end user authorisation flow. - Purpose of this sandbox provider: The integration scenario that you can use this sandbox provider to test.
We're always adding more providers to our API, and this list changes regularly when our level of support for regions changes, or we develop new payment flows.
To find out whether we have or are developing a sandbox provider you can use to test in a specific region, please contact us.
Sandbox provider_id | Sandbox provider display_name | What you can test with this sandbox provider |
---|---|---|
mock-payments-de-embedded | Mock European Payments – Embedded Flow | German payments with an embedded authorisation flow. |
mock-payments-de-redirect | Mock German Payments – Redirect Flow | Test German payments with a redirect authorisation flow. |
mock-payments-de-redirect-additional-input-text | Mock German Payments – Redirect Flow with additional inputs | Test German payments with a redirect authorisation flow that require additional inputs (such as branch code or IBAN). |
mock-payments-es-redirect | Mock Spain Payments – Redirect Flow | Test Spanish payments with a redirect authorisation flow. |
mock-payments-fi-redirect | Mock Finland Payments – Redirect Flow | Test Finnish payments with a redirect authorisation flow. |
mock-payments-fr-redirect | Mock France Payments – Redirect Flow | Test French payments with a redirect authorisation flow. |
mock-payments-fr-redirect-additional-input | Mock France Payments – Redirect Flow - Additional Input | Test French payments with a redirect authorisation flow that require additional inputs (such as branch code or IBAN). |
mock-payments-gb-redirect | Mock UK Payments - Redirect Flow | Test UK payments with a redirect authorisation flow. |
mock-payments-gb-redirect-unhealthy | Mock UK Payments - Redirect Flow (Unhealthy) | How a bank experiencing downtime displays as part of the authorisation flow, for a UK payment. |
mock-payments-ie-redirect | Mock Ireland Payments – Redirect Flow | Test Irish payments with a redirect authorisation flow. |
mock-payments-it-redirect | Mock Italy Payments – Redirect Flow | Test Italian payments with a redirect authorisation flow. |
mock-payments-lt-redirect | Mock Lithuania Payments – Redirect Flow | Test Lithuanian payments with a redirect authorisation glow. |
mock-payments-nl-redirect | Mock Netherlands Payments – Redirect Flow | Test Dutch payments with a redirect authorisation flow. |
mock-payments-no-redirect | Mock Norway Payments – Redirect Flow | Test Norwegian payments with a redirect authorisation flow. |
mock-payments-pl-redirect | Mock Poland Payments – Redirect Flow | Test Polish payments with a redirect authorisation flow. |
mock-payments-pt-redirect | Mock Portugal Payments – Redirect Flow | Test Portuguese payments with a redirect authorisation flow. |
ob-natwest-vrp-sandbox | Natwest VRP Sandbox | Test VRP mandate authorisation with a Natwest branded user interface. |
ob-uki-mock-bank-sbox | UKI Mock Bank Sandbox | Test VRP mandate creation and authorisation in the mock bank. |
Additional inputs credentials
In case of using mock providers that are mocking a bank presenting an embedded flow, they will require additional authorization credentials.
An example is when using the mock-payments-de-embedded
mock provider.
"psu-id" (corresponding to the User ID): "test_username",`
"psu-password" (corresponding to the Password): "test_password"
If using the HPP, for example, after choosing the mock-payments-de-embedded
provider, the user will be prompted to fill in the login credentials to proceed.
Updated 3 months ago