imageTesting One Off 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/

Card Payments

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. Fill out the payer information fields.

The fields do not affect the test scenario, you can fill them with any data you want.

6. Enter the magic values and credit card data for your scenario.

  1. Enter magic values as the card holder’s first and last name depending on which scenario you want to test:

    First Name Last Name Will 3DS be triggered? Will the payment be successful? Statuses for the payment Scenario Description
    MAGICVALUE AUTH

    yes

    yes

    InitiatedProcessedGuaranteed

    "Happy path" with 3DS

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

    no

    yes

    InitiatedProcessedGuaranteed

    "Happy path" without 3DS

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

    PAYMENT DELIVERED

    no

    yes

    InitiatedProcessedGuaranteedDelivered

    "Happy path" with delivered payments

    Use this scenario if you want to create payments that go into the delivered status.

    MAGICVALUE EXPIRED

    no

    no

    InitiatedFailed

    Card is expired

    Use these scenarios if you want to test payments that fail.
    MAGICVALUE FRAUD

    no

    no

    InitiatedFailed

    Card is declined

    MAGICVALUE NOT ENOUGH BALANCE

    no

    no

    InitiatedFailed

    Card doesn't have enough balance

  2. Use one of the demo credit cards for the credit 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 payment is now created according to your scenario. You'll receive the following notifications:

Within the next 30 seconds:

image Initiated

image Processed

image Guaranteed

This is the end of this scenario.

Within the next 1 minute:

image Initiated

image Failed (immediately after initiated)

This is the end of this scenario.

Bank Transfer Payments

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. Fill out the payer information fields.

Fill the payer information fields with dummy data. You have two options depending on what you want to test:

A) You don't use any magic values in the payer name fields.

This enables you to test displaying the instructions element on demand after you displayed the bank transfer payment element. You need a test payment that stays in status Initiated for this, and any non-magic-value test name like Peter Payer will put the payment in this status.

B) You use magic values in the payer name fields to make the test payment go into a specific status.

Note that if you do this, you won't be able to test displaying the instructions element on demand.

First Name Last Name Statuses for payments with this card Scenario Description
PAYMENT GUARANTEED

InitiatedProcessedGuaranteed → moved daily at 4:00 PM UTC (Monday through Friday) Delivered

"Happy path" with realistic delivered payments

Use this scenario if you want to create payments that go into the delivered status after 24 hours.

PAYMENT DELIVERED

InitiatedProcessedGuaranteedDelivered

"Happy path" with immediately delivered payments

Use this scenario if you want to create payments that go into the delivered status immediately.

In both cases, the instructions will be displayed to you after filling out the payer information and confirming them.

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

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

7. Confirm the Checkout Session.

Confirm the session using the url you received from the event listener.

The response returns the url you need to display the instructions on demand.

8. Check the notifications.

You will receive the following callbacks:

Within the next 30 seconds:

image Initiated

You can now display the instructions element.

If you put the payment into Guaranteed:

image Initiated

image Processed

image Guaranteed

If you put the payment into Delivered:

image Initiated

image Processed

image Guaranteed

image Delivered

This is the end of this scenario.

9. Displaying the instructions element on demand

If you didn't use any magic values, you can now display the instructions again.

1. Open the url for the instructions in your browser.

You received the url for displaying the instructions in this step: 7. Confirm the Checkout Session.

2. Add the event listener code for receiving the postMessages for instructions in your browser.

4. Click the button that confirms you read the instructions and closes them.

Check the postMessage after clicking the button to ensure you got a success message back.

After your payer read the instructions, they can click on the action button to close the instructions. In that case, the event listener will return a successful postMessage.

The postMessage contains the following information:

{
source: "checkout_session",
success: true
}

This error is returned if your payer closes the instructions with the X close button instead of the action button.

This could still mean that your payer read the instructions. In any case, you should make sure that the instructions are available to your payer to look them up again. You can achieve this by making them available again through a button in the UI or by sending them to your payer via email (see One Off Payments: Emails to Your Payer - Bank Transfer Instructions).

errors array

Array of errors. Each error contains:

{
"errors": [
	"0":{
		"type": "cancelled",
		"message": "The session has been cancelled by the user."
   		}
		],
source: "checkout_session",										
success: false
}

This error is returned if the bank transfer instructions are not available. This can be the case if the payment is in any other status than Initiated.

errors array

Array of errors. Each error contains:

{
"errors": [
	"0":{
		"type": "unavailable",
		"message": "The bank transfer instructions are not available."
   		}
		],
source: "checkout_session",										
success: false
}