# Testing
source: https://developer.mastercard.com/ob-accept-payments/documentation/developer-support/testing/index.md

## UK - Simulator Bank {#uk---simulator-bank}

The Simulator bank is a UK test bank implementation in Sandbox to enable end-to-end testing of your solution by:

* Replicating the flow of API requests based on the Open Finance API Standard in the UK
* Validating the message structure based on the Open Finance API Standard in the UK and selected scheme / payment rail (UK Faster Payments for example)
* Mocking the API responses for the happy path flows
* Replicating the end-to-end experience on the UI, for example simulation of going through the SCA (Strong Customer Authentication) with the bank
* Providing the ability to simulate some advanced scenarios (including unhappy paths) through a simple selection on the UI  

The Simulator Bank Administration UI provides additional functionality to support you while testing, for example:

* View Account Details
* Update Balance
* View Transaction History
* View and Manage Mandates

## Simulator Bank Admin UI {#simulator-bank-admin-ui}

The Simulator Bank provides an administration interface for managing the bank accounts and associated information that can be used with the Simulator Bank in Sandbox. This can be useful while testing. For example, you can view the list of available accounts for your PSU, update account balances, view associated payment history, create a list of payment mandates, and so on.
Note: You are accessing this from your consumers' (PSU) perspective. Therefore, rather than managing your own (destination) accounts, you will manage the PSU (source) accounts that can be used to make payments within our sandbox environment using our API for testing purposes.

#### Onboarding to the Sandbox {#onboarding-to-the-sandbox}

To start testing with any of the test banks, you need to be onboarded to Sandbox. This is part of the overall onboarding process.

#### Environment and Access Details {#environment-and-access-details}

|        **Application**         |                         **Sandbox environment**                         |                       **User credentials**                        |
|--------------------------------|-------------------------------------------------------------------------|-------------------------------------------------------------------|
| Simulator Bank Admin Interface | [Sandbox environment](https://mtf.app.openbanking.mastercard.eu/aspsp/) | The credentials will be provided after onboarding to the sandbox. |

Two sets of credentials will be provided, one for the Default user role and one for the Advanced user role. Both users will have their own set of bank accounts associated with the simulator bank. The Advanced user role will enable the user to perform additional advanced scenarios in the SCA journey (see UK Simulator Bank---Scenarios).
Note: From the User Admin Interface perspective, the available functionality for the Default and Advanced users is identical. Thus, the documentation below covers both user roles.

#### Sign in to the Simulator Bank {#sign-in-to-the-simulator-bank}

To access the Simulator bank Admin Interface, use the credentials for one of your users in the log-in form as shown below.
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank1.png)

#### View Account Details {#view-account-details}

Once the user logs in to the Simulator Bank Admin Interface, all accounts associated with the logged-in user will be displayed in the dashboard.

On selecting any of the accounts - more details about the account are available.
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank2.png)

#### Update Balance {#update-balance}

The Update Balance feature enables the user to update the balance by credit/debit so that boundary conditions can be validated while doing SIP and CVRP payments.

You can update the balance of the selected account by Dr/Cr.
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank3.png) ![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank4.png)

#### Transaction history {#transaction-history}

Transaction history of the selected account can be viewed to validate if a specific payment (through Accept Payments or Payment Mandates) worked and the account balance was updated.
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank5.png)

#### View the list of Connections (VRP Consents / Mandates) {#view-the-list-of-connections-vrp-consents--mandates}

With the banks implementing the UK Open Finance API Standard, each time you create a mandate through Mastercard Open Finance Pay, an associated VRP consent is created on the bank side. As a correspondence to the Mandate in Mastercard Open Finance Pay, this holds the PSU Consent / Authorization for the PISP (Payment Initiation Service Provider) to initiate the cVRP payments from the bank account based on the specified set of control parameters (limit amount per payment, limit amount per month, and expiration date) which the bank uses to validate the payments initiated based on the respective VRP Consent (Mandate).

The Simulator Bank Admin Interface allows you to view the created VRP consents for a selected account as connections (see main menu).

Active Connections: by default, the system will display the connections (VRP Consents) that are currently active (AUTHORIZED).
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank6.png)

History: All the connections (VRP Consents) that were Revoked or Expired will be displayed under a separate tab. Click History to view them.
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank7.png)

### Manage a Connection (VRP Consents / Mandates) {#manage-a-connection-vrp-consents--mandates}

Depending on the Connection status (VRP Consent), clicking on the Manage or View button expands additional details for the Connection (VRP Consent).
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank8.png)

##### View the Payment History {#view-the-payment-history}

Payment History lists all the transactions performed under the selected mandate.
![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/sim_bank9.png)

##### Revoke a Connection {#revoke-a-connection}

Remove connection is applicable only for the Active Mandates. It will not be enabled for Expired or Deleted Mandates.

## Simulator Bank Scenarios {#simulator-bank-scenarios}

Find below the details of the available scenarios and tools for testing with Simulator Bank in Sandbox. During some of the scenarios, an SCA (Strong Customer Authentication) flow with the Simulator Bank will be involved, replicating the behavior with UK banks where the PSU needs to be redirected to the Bank for an SCA.

#### Pre-requisites {#pre-requisites}

To start testing the scenarios, you need to be onboarded to Sandbox (refer to the Quick Start guide for onboarding details) and authenticated with the API (please check API Basics).

#### Available Simulator Bank Channels for SCA flow {#available-simulator-bank-channels-for-sca-flow}

Simulator Bank's SCA flow is now available on the Web. When you receive the **flowUrl** from the API, initiate the UI flow from a desktop browser or from a mobile browser.

#### PSU credentials for the SCA flow {#psu-credentials-for-the-sca-flow}

Currently we have two types of User Roles available for accessing Simulator Bank during the SCA flow. You will receive your credentials as part of your onboarding to Sandbox.

Please also check the Simulator Bank Admin UI guide for additional functionality that may be of help during testing the scenarios.

|     **Role**     |                                                                     **Functionality available in the SCA flow**                                                                     |
|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| UkFasterPayments | GBP                                                                                                                                                                                 |
| Default User     | The default user can perform basic, happy path scenarios.                                                                                                                           |
| Advanced User    | In addition to the capabilities of Default user, the Advanced user can replicate a list of pre-defined advanced scenarios (some alternative happy path and unhappy path scenarios). |

Note: When you are logged in with the Advanced User, you will see a dedicated icon on the Simulator Bank's SCA interface that will allow you to select an advanced scenario.

If no advanced scenario is selected, then the flow will continue as per the basic path.

## EU Test Banks {#eu-test-banks}

### Testing accept payment - Nordics {#testing-accept-payment---nordics}

Warning: The test provider for the Nordics is our legacy test bank. Successful payments using this bank will terminate on an initiated status. In production, you can expect the majority of successful payments to terminate on `Payment_Executed_Debited` or `Payment_Executed_Credited`.

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.

1. What a test provider is
2. How to test accept payments

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

A test provider is a provider that simulates the interaction and behavior 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.

This table shows what payment outcomes that 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'                  |
| Payment succeeded | Authorization of the payment failed             | Choose 'Failed after authorization' |

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

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

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

![](https://static.developer.mastercard.com/content/ob-accept-payments/uploads/time-in-pending_a.png)

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

**Test Users**

We offer a collection of different test users for SEPA payments as described here:

|      **User**      |                **Login method**                | **Password** | **OTP** | **Specified Tan** |                  **Scenarios available**                   |
|--------------------|------------------------------------------------|--------------|---------|-------------------|------------------------------------------------------------|
| max.mustermann     | Embeded flow with OTP                          | 12345        | 987654  | Any six digits    | Successful, Service down, Insufficient Funds and Bank down |
| mattias.mustermann | Redirect flow                                  | 12345        | n/a     | n/a               | Successful, Service down, Insufficient Funds and Bank down |
| erika.mustermann   | Embedded flow with OTP and choice for OTP type | 12345        | 987654  | Any six digits    | Successful, Service down, Insufficient Funds and Bank down |
| dan.mustermann     | Decoupled flow                                 | 12345        | 987654  | n/a               | Successful, Service down, Insufficient Funds and Bank down |

