Testing Self-Managed Recurring 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/

 

image Testing Card Payment Scenarios

1. Prepare your test scenario.

  1. Decide which recipient you want to use.

     

  2. Create a Checkout Session.

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

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

     

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

     

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

     

2. Enter the magic values for your test scenario.

Enter the magic values in the fields First Name and Last Name. The other payer data fields do not affect the test scenario.

First Name Last Name Will the card be tokenized? Will 3DS be triggered? Will payments with this card be successful? Statuses for payments with this card Scenario Description
RECURRING CARD AUTH

yes

yes

yes

InitiatedProcessedGuaranteed

"Happy path" with 3DS

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

yes

no

yes

InitiatedProcessedGuaranteed

"Happy path" without 3DS

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

PAYMENT DELIVERED

yes

no

yes

InitiatedProcessedGuaranteedDelivered

"Happy path" with delivered payments

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

RECURRING CARD EXPIRED

yes

no

no

InitiatedCancelled

Card is expired

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

yes

no

no

InitiatedCancelled

Card is declined

RECURRING CARD NOT ENOUGH BALANCE

yes

no

no

InitiatedCancelled

Card doesn't have enough balance

3. Enter test 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

4. Complete the test payment.

  1. 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.

     

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

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

     

  3. Confirm the Checkout Session.

    You'll receive an payment method token and an mandate ID in the response.

     

6. Create a payment with the tokenized card.

All payments you charge with the tokenized card will behave according to the scenario you chose. The payer's first and last name (which include the magic values) are part of the payment method token you received and can't be changed.

Create and charge a payment with the payment method token and mandate ID you received.

This request requires the recipient and its exact configuration (fields, items, etc.).

 

5. Check the callbacks for your test scenario.

You'll receive the following notifications via callbacks:

If you chose a scenario with successful payments:

image Initiated

image Processed

image Guaranteed

f you chose a scenario with successful payments that go into the delivered status:

image Initiated

image Processed

image Guaranteed

image Delivered

If you chose a scenario with failed payments:

image Initiated

image Cancelled

 

 

 

imageTesting Direct Debit Payment Scenarios

1. Prepare your testing scenario.

  1. Decide which recipient you want to use.

     

  2. Create a Checkout Session.

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

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

     

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

     

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

     

2. Enter the magic values for your test scenario.

Enter the magic values in the fields First Name and Last Name. The other payer data fields do not affect the test scenario.

First Name Last Name Will the bank account be tokenized? Will payments with this bank account be successful? Statuses for payments with this card Scenario Description

DIRECT DEBIT

SUCCESS

yes

yes

Initiated

"Happy path" but payments will not move to further statuses.

Use this scenario if you want to tokenize the bank account and create successful payments.

PAYMENT DELIVERED

yes

yes

InitiatedProcessedGuaranteedDelivered

"Happy path", payments will move into status delivered.

Use this scenario if you want to tokenize the bank account and create successful payments that move into status Delivered.

DIRECT DEBIT

FAIL

yes

no

InitiatedCancelled

Payment failure

Use this scenario if you want to tokenize the bank account and create payments that will fail.

DIRECT DEBIT

CONNECTIVITY ERROR

no

-

-

Connectivity failure

Use this scenario if you want to simulate a connectivity error (either to Flywire or to the bank) that prevents tokenization of the bank account.

3. Enter test bank account details.

All test bank accounts work with all magic values and trigger the chosen scenario.

For SEPA direct debit

Country

Spain
(The demo IBAN is a Spanish IBAN, which means you must choose Spain as a country.)

IBAN

ES7921000813610123456789

For BACS direct debit

Country

United Kingdom

Sort Code

60-00-01

Account Number

00000019

For ACH direct debit

Country

United States

Routing Number

123456789

Account Number

123456789

Account Type You can choose either Checking or Savings, both will work for the test.

For EFT Canada direct debit

Connect to the test bank account via Plaid with the following credentials. You can pick any bank you like at the "Pick your bank" screen, and any bank account at the "Pick your account" screen.

Username

user_good

Password

pass_good

4. Complete the test payment.

Confirm the mandate screen and send the form.

5. For connectivity fail scenarios: Check the error message.

If you chose the "connectivity fail" scenario, you'll see "Transaction failed" in the UI with a hint that connectivity issues occurred. The test scenario ends with that.

6. For all other scenarios: Confirm the Checkout Session.

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

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

     

  2. Confirm the Checkout Session.

    You'll receive an payment method token and an mandate ID in the response.

     

7. Create a payment with the tokenized bank account.

All payments you charge with the tokenized bank account will behave according to the scenario you chose. The payer's first and last name (which include the magic values) are part of the payment method token you received and can't be changed.

Create and charge a payment with the payment method token and mandate ID you received.

This request requires the recipient and its exact configuration (fields, items, etc.).

 

8. Check the callbacks for your test scenario.

You'll receive the following notifications via callbacks:

If you chose a scenario with successful payments that doesn't move the payment:

image Initiated

If you chose a scenario with successful payments that moves payments into delivered:

image Initiated

image Processed

image Guaranteed

image Delivered

If you chose a scenario with failed payments:

image Initiated

image Cancelled