# Testing Payments
source: https://developer.mastercard.com/open-finance-europe/documentation/unlicensed/aiia-pay/testing/testing-payments/index.md

Accepting and making payments are sensitive actions, so it is important to build a solution that manages all possible scenarios.

We have created a test provider that enables you to test all possible scenarios in a simple and safe environment.

This section details:

1. What a test provider is

2. How to test accept payments

3. How to test payouts

### What is a test provider? {#what-is-a-test-provider}

A test provider is a provider that simulates the interaction and behaviour of a real provider. Our test provider allows you to decide the outcome of the payment, simulate different aspects of a payment, and explore what could possibly go wrong.

We have created one test provider, called "Test Bank", that can be chosen from the bank selector in the flow.

The test provider gives you the option to set the following parameters:

* Outcome of the payment. (See table below)
* Payment error reason if the payment failed. You can choose any error that we expose.
* Delay in communication with a provider in milliseconds.

The table shows what payment outcomes you can choose and what payment scenario they simulate.

|       **Name**       |                    **Type**                     |             **Option**              |
|----------------------|-------------------------------------------------|-------------------------------------|
| Payment succeeded    | Payment will always succeed                     | Choose 'succeeded'                  |
| User cancelled       | Payment will always return cancelled after flow | Choose 'Cancelled'                  |
| Authorisation failed | Authorisation of the payment fails              | Choose 'Failed after authorisation' |

The test provider gives you different options depending on the payment product. The specifics of for each product is detailed below.

### Testing accept payments {#testing-accept-payments}

There are a number of scenarios that are important to test with accept payments before going live. In addition to setting the above mentioned parameters, our test provider offers the option to set:

* **Time in pending** - Time (in seconds) the payment stays in a non-terminated, "pending" state after authorisation.

![Choose Outcome of Payment](https://static.developer.mastercard.com/content/open-finance-europe/uploads/test-provider-accept-payments2.png)

### Testing payouts {#testing-payouts}

Our payouts product models payments and authorisation explicitly. We therefore offer some slightly different parameters to set when you test payouts.

* *Payments* outcome when several payments are authorized.
* *Authorisation* outcome. You can choose any state.

You have the opportunity to simulate the following payments outcome:

|        **Name**        |             **Type**              |   **Option**   |
|------------------------|-----------------------------------|----------------|
| All payments succeeded | All payments will always succeed. | `AllSucceeded` |
| All payments failed    | All payments will fail.           | `AllFailed`    |
| First payment failed   | First payment will fail.          | `FirstFailed`  |
| All payments cancelled | All payments will be cancelled.   | `AllCancelled` |

