Testing Pre-Authorization Payments

This page guides you through testing your integration - it guides you through creating payments and testing various behaviors. It does not cover all possible payment flows. For simulating payment flows and testing callbacks for each payment status, refer to Testing Payment Flows.

Testing requires you to make API calls in the Sandbox environment:

Make sure you have credentials for the API Sandbox.
Remember to use the Sandbox environment for all tests:
https://api-platform-sandbox.flywire.com/

1. Choose the recipient for the test payment.

2. Create a Checkout Session.

Since you are testing status notifications, make sure to provide a notifications URL where you can receive the notifications via callbacks.

You'll receive a URL for the UI form in the API response.

3. Open the URL for the form in your browser.

4. In your browser, add the event listener code to the page.

5. Enter the magic values for the scenario you want to test.

Enter the magic values in the fields First Name and Last Name. All other fields do not affect the test scenario, you can fill them with any data you want.

First Name Last Name Payment behavior Callbacks you will receive Scenario Description
MAGICVALUE AUTH

Payment will stay in Initiated until you capture it.

image Initiated

image Authorized (immediately after initiated)

"Happy path" with 3DS

Use this scenario if you want to test 3DS behavior.
MAGICVALUE APPROVED

Payment will stay in Initiated until you capture it.

image Initiated

image Authorized (immediately after initiated)

"Happy path" without 3DS

Use this scenario if you want to skip the 3DS verification.

6. Enter test card details.

Does it matter which card I use for the scenario?

No. All test cards work with all magic values and trigger the chosen scenario.

What is the purpose of the different test cards?

You can try out different cards from different countries to test the behavior of the element when card country and payer country don't match.

The demo cards must be used together with cardholder name magic values.

Number Expiration date CVV Currency Issuing Country Type

Visa

4010 1000 0000 0016 03/30 737 EUR DE Debit
4988 4388 4000 0012 03/30 737 EUR ES Debit
4242 4201 0000 0017 03/30 737 GBP GB Credit
4761 3600 0000 0017 03/30 737 INR IN Debit
4111 1111 1111 1111 03/30 737 USD US Credit

Mastercard

2222 4000 1000 0016 03/30 737 CAD CA Credit
5163 6136 0000 0014 03/30 737 AUD AU Debit
5252 5202 0000 0017 03/30 737 JPY JP Debit
5454 5454 5454 5454 03/30 737 USD US Credit

American Express (Amex)

3700 0000 0000 002 03/30 7373 USD

US

Credit

7. Send the form.

image

If you used a scenario that triggers 3DS authentication, you now see the Flywire 3DS authentication simulator. Enter the word password in the password field and click on continue to complete the authentication.

8. Check the console in your browser's development tools.

The event listener will return the URL for confirming the Checkout Session.

9. Confirm the Checkout Session.

You'll receive the payment reference in the response.

10. Check the notifications.

The Pre-Authorization Payment is now created. You'll receive the following notifications:

image Initiated

image Authorized (immediately after initiated)

11. Capture the payment.

12. Check the notifications.

You'll receive the following notifications:

image Processed

image Guaranteed