# Open Banking Bank Transfer Domestic
source: https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/alt-pay-methods/bank-transfer/open-banking/index.md

Open Banking Bank Transfer is a payment method available to payers in the United Kingdom that allows them to purchase or pay for goods and services using direct online transfers from their bank account. Payers are redirected to their bank where they can initiate an instant bank transfer. Payers have complete visibility of the transactions and the peace of mind that their transactions will be authorized and completed in a secure and trusted environment. By utilizing the Faster Payment Service, Open Banking Bank Transfer offers almost real-time payments and settlement along with the following benefits:

* Reduced friction and abandonment that may help increase revenue
* Reduced customer disputes that could lead to reduction in costs
* Potential to reduce fraud
* Ready for PSD2 (Revised Payment Services Directive), FCA (Financial Conduit Authority) and other regulatory requirements
* Single API experience for service consumers which makes a highly fragmental ecosystem of banks

Open Banking Bank Transfer currently supports transactions in GBP currency only.

## Prerequisites {#prerequisites}

To offer Open Banking Bank Transfer as a payment method through the Mastercard Gateway:

* Your payment service provider must configure your merchant profile on the gateway using the details of your account with the PISP.
* It is recommended that you opt for the Notifications service ([Webhook](https://developer.mastercard.com/mastercard-gateway/documentation/gateway-features/webhook-noti/index.md)) to receive notifications if the payment is successful. Warning: To support translations for the languages that gateway supports, the `interaction.locale` field is added in the open banking SDK API. If you do not pass any value in the `interaction.locale` field, then the predefined browser language of a payer will be the preferred language for translation.

## Open Banking Bank Transfer Integration {#open-banking-bank-transfer-integration}

If you are using your own payment page and want to offer Open Banking Bank Transfer as a checkout option to your payers, you must use the Open Banking JavaScript SDK (open-banking.min.js) provided by the gateway.

Warning: You must upgrade to API version 69 or later to use JS-SDK version 1.3.0. SDK Version 1.3.0 is supported between version 69 and version 70. SDK version 1.4.0 is supported from version 71 onwards. Warning: The length of the OrderID field for Open Banking transaction must be less than or equal to 18. Follow the integration steps as listed below.

<br />

### Step 1: Create a session {#step-1-create-a-session}

Create a session by submitting a [Create Session](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#session) request from your server-side application. Specify a session authentication limit of 25. The response returns a session ID that you must use in the subsequent steps to reference this session.

| HTTP Method |                                   URL                                   |
|-------------|-------------------------------------------------------------------------|
| POST        | {{host}}/api/rest/version/100/merchant/your_gateway_merchant_ID/session |

```json
{
  "session": {
    "authenticationLimit": 25
  }
}
```

### Step 2: Update the session with the order, transaction, and browser payment details {#step-2-update-the-session-with-the-order-transaction-and-browser-payment-details}

Update the session with at least the order ID, transaction ID, order amount, currency and the browser payment details (operation, return URL) by submitting an [Update Session](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#session) request from your server-side application. Ensure you use the same order ID and transaction ID when subsequently configuring the Open Banking SDK and preparing the callback interface.

Note that browserPayment.returnURL is the URL to which you want the payer's browser to be redirected after the payer completes the payment at their bank's website. The payer will be redirected to this URL irrespective of the success or otherwise of the payment. If you do not provide the return URL, the gateway will be unable to redirect the payer's browser to your site.

| HTTP Method |                                           URL                                           |
|-------------|-----------------------------------------------------------------------------------------|
| PUT         | {{host}}/api/rest/version/100/merchant/your_gateway_merchant_ID/session/your_session_ID |

```json
{
  "order": {
    "amount": "100.00",
    "currency": "GBP",
    "id": "1234567"
  },
  "transaction": {
    "id": "98765432"
  },
  "browserPayment": {
    "operation": "PAY",
    "returnUrl": "https://example.com"
  }
}
```

##### Using Line of Business {#using-line-of-business}

Include the `lineOfBusiness` field in the Update Session request if you have requested multiple instances of Open Banking Bank Transfer with different receivables accounts. As a prerequisite, your merchant profile must be configured to support multiple lines of businesses based on your receivables account name and details. Each line of business can have different payment parameters, such as bank account.

For example, `lineOfBusiness` = TICKET_SALES can have a different bank account from `lineOfBusiness` = MERCHANDISING. If the line of business on your profile is "null", then do not enter any value in the `lineOfBusiness` field.

Based on your merchant profile setup, you may need to use the `lineOfBusiness` value when you configure the Open Banking interaction to use the Open Banking JavaScript SDK.

### Step 3: Include the Open Banking JavaScript SDK in your payment page {#step-3-include-the-open-banking-javascript-sdk-in-your-payment-page}

Include the Open Banking JavaScript SDK (open-banking.min.js) provided by the gateway in your payment page by adding a script element within the head element. This places an OpenBanking object into the window namespace. Also, add the meta element within the head element. This will scale the Open Banking SDK accordingly in all web and mobile browsers. Ensure that you are already set up for Open Banking.

```html
<script src="{{host}}/static/open-banking/1.0.0/open-banking.min.js</script>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
```

### Step 4: Configure the Open Banking interaction {#step-4-configure-the-open-banking-interaction}

When loading your payment page, initiate the Open Banking interaction by invoking the [OpenBanking.configure()](https://gateway.mastercard.com/api/documentation/apiDocumentation/open-bankingsdk/version/latest/function/configure.html?locale=en_US) method. This method should be called only once for the page load.

Alert: The merchant name that you provide in the JavaScript SDK integration must match the name that is available on the enrollment form, Merchant Manager, and Merchant Administration portals.

<br />

```js
var config = {
  merchantId: '<your_gateway_merchant_ID>', // required
  merchantName: '<your_merchant_name>', // required for display purpose
  amount: '<amount>', // required for display purpose
  orderId: '<order_ID>', // required and must match the value provided in Step 2
  transactionId: '<transaction_ID>', // required and must match the value provided in Step 2
  sessionId: '<your_session_ID>', // required
  wsVersion: '', // optional, defaults to 63, when provided must match the version provided in Step 1 and 2
  locale: '' // optional
};

OpenBanking.configure(config, function (response) {
  // Successful response sample: {status: 'SUCCESS', explanation: 'Configured successfully!'}
  console.log(response);
});
```

##### Merchant Details {#merchant-details}

The merchantId is required so that the gateway can correctly determine your payment options.

The merchantName field is submitted to the Open Banking server. It may be displayed to the payer during the Open Banking interaction. Provide your trading name, in other words, the name known to your payer.

##### Version {#version}

The API version must match the version that you used when submitting the [Create Session](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#session) request.

##### Callback {#callback}

Use the callback parameter to define the actions to be invoked after OpenBanking.configure() has completed. For example, you may want to log if the method was successful.

```js
var callbackFunction = function(response) {
  // Successful response sample:
  // {status: 'SUCCESS', explanation: 'Configured successfully!'}
  console.log(response);
};

OpenBanking.configure(config, callbackFunction);
```

The OpenBanking.configure() call might return the following error responses. Where an error is returned, do not proceed to the next step. Offer the payer another payment method.

| response.cause |                                                                       resp.explanation                                                                        |                                                       Required Action                                                        |
|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|
| Error          | Missing argument: Merchant ID, Merchant Name, Merchant URL, Hosted Session ID, and a callback function are all required arguments for the configure() method. | Fix your integration. You must provide all mandatory request fields.                                                         |
| Error          | Callback must be a function.                                                                                                                                  | Fix your integration.                                                                                                        |
| Error          | API version must be MIN_VERSION or greater.                                                                                                                   | Fix your integration. Set wsVersion to 100. The version must match the version used in the create session or update session. |
| Error          | interaction locale format error.                                                                                                                              | Provide correct format locale like It_LT, It, It-LT.                                                                         |

### Step 5: Launch the Open Banking UI {#step-5-launch-the-open-banking-ui}

If OpenBanking.configure() is successful, launch the Open Banking UI by invoking the [OpenBanking.launchUI()](https://gateway.mastercard.com/api/documentation/apiDocumentation/open-bankingsdk/version/latest/function/launchUI.html?locale=en_US) method.

Ensure to add details regarding the callback error if the launch UI () function is unable to get the response from the PAYMENT_OPTIONS_INQUIRY request or when the API gets timed out. When you receive the JavaScript SDK page and the callback error, it is your responsibility to update the payer.

```js
OpenBanking.launchUI();
```

#### Open Banking through Hosted Checkout {#open-banking-through-hosted-checkout}

Hosted Checkout integration allows you to collect payment details from your payers through an interaction that the Mastercard Gateway hosts and displays.

The Open Banking payment method with the PayFrom Bank payment and its logo is added on the Hosted Checkout payment page. You can see the list of banks that support Open Banking, select the bank and proceed with the payment.

You can use Open Banking as a payment option, after your payment service provider sets it up and activates it for you.

## Retrieving Transaction Details {#retrieving-transaction-details}

You can retrieve transaction details for the Open Banking interaction using the following options:

* [Retrieve Order](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) or [Retrieve Transaction](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) operations
* Order and Transaction Search in Merchant Administration: You can look up the transaction using the reference number provided to the payer on the payment receipt. This reference number will also be shown on your and your payer's bank statement to allow you to further validate the transaction.

### Understanding the order and transaction status {#understanding-the-order-and-transaction-status}

The table below outlines the possible scenarios that you may encounter after initiating an Open Banking Bank Transfer payment and shows the corresponding transaction response codes and order status. It provides guidance on when you should ship the goods to your payer or whether you should wait for Webhook notifications to receive the latest status of that transaction. You are required to be set up for Webhook notifications separately or must poll the gateway using the aforementioned options to check the latest transaction status before shipping any goods to the payer.

|       Transaction Gateway Response Code        |   Order Status    |                                                                                                         Description                                                                                                         |
|------------------------------------------------|-------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `response.gatewayCode` = SUBMITTED             | status= INITIATED | Open Banking transaction has been submitted to ASPSP; payment has not been initiated. Do not ship goods as of now.                                                                                                          |
| `response.gatewayCode` = CANCELLED             | status= FAILED    | Open Banking transaction has been aborted by the payer during processing; payment will not be initiated or settled in this case. Do not ship goods for this order.                                                          |
| `response.gatewayCode` = TIMED_OUT             | status= FAILED    | Open Banking transaction has been timed out during processing; payment will not be initiated or settled in this case. Do not ship goods for this order.                                                                     |
| `response.gatewayCode` = NOT_SUPPORTED         | status= FAILED    | Open Banking transaction has been rejected by ASPSP during processing; payment will not be initiated or settled in this case. Do not ship goods for this order.                                                             |
| `response.gatewayCode` = INSUFFICIENT_FUNDS    | status= FAILE     | Open Banking transaction has been rejected by ASPSP during processing due to insufficient funds in the payer's account; payment will not be initiated or settled in this case. Do not ship goods for this order.            |
| `response.gatewayCode` = DECLINED              | status= FAILED    | Open Banking transaction has been rejected by ASPSP during processing; payment will not be initiated or settled in this case. Do not ship goods for this order.                                                             |
| `response.gatewayCode` = APPROVED              | status= CAPTURED  | Open Banking transaction has been approved by ASPSP, settlement is completed for this order.                                                                                                                                |
| `response.gatewayCode` = PENDING               | status= CAPTURED  | Open Banking transaction has been approved by ASPSP, but settlement is pending for this order.                                                                                                                              |
| `response.gatewayCode` = AUTHENTICATION_FAILED | Status = FAILED   | Open Banking transaction has been rejected by ASPSP during processing due to invalid authentication details provided by the payer; payment will not be initiated or settled in this case. Do not ship goods for this order. |

### Examples {#examples}

#### Sample Retrieve Transaction Response for a Submitted Open Banking Interaction {#sample-retrieve-transaction-response-for-a-submitted-open-banking-interaction}

Here is an example of a Retrieve Transaction response showing a submitted Open Banking interaction (response.gatewayCode = SUBMITTED)

```json
{
  "amount": 82113.13,
  "chargeback": {
    "amount": 0,
    "currency": "GBP"
  },
  "creationTime": "2020-08-17T09:35:27.250Z",
  "currency": "GBP",
  "customer": {
    "email": "John@example.com"
  },
  "device": {
    "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
  },
  "id": "992608474",
  "lastUpdatedTime": "2020-08-17T09:36:04.146Z",
  "lineOfBusiness": "AIR_TICKETS",
  "merchant": "TESTMERCHANT1",
  "merchantAmount": 82113.13,
  "merchantCurrency": "GBP",
  "reference": "TEST-SUCCEED",
  "result": "SUCCESS",
  "shipping": {
    "address": {
      "city": "Shipsville",
      "country": "GBR",
      "postcodeZip": "EH67DX",
      "stateProvince": "Scotland",
      "street": "2ShippingHeights",
      "street2": "ShipsDrive"
    },
    "contact": {
      "email": "John@example.com",
      "firstName": "John",
      "lastName": "Doe"
    }
  },
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "12345XXX-XXXX-4156-XXXX-f6eeef0478cf"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "status": "INITIATED",
  "totalAuthorizedAmount": 0,
  "totalCapturedAmount": 0,
  "totalRefundedAmount": 0,
  "transaction": {
    "browserPayment": {
      "interaction": {
        "status": "RETURNED_TO_MERCHANT",
        "timeInitiated": "2020-08-17T09:35:27.272Z",
        "timeRedirected": "2020-08-17T09:35:59.967Z",
        "timeReturned": "2020-08-17T09:36:04.061Z"
      },
      "operation": "PAY",
      "redirectUrl": "<hostname>/bpui/ob/out/BP-06f552c44de094aca21ee0abdf82303b",
      "returnUrl": "<hostname>/apmDemoApp/complete.html"
    },
    "customer": {
      "email": "John@example.com"
    },
    "device": {
      "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36"
    },
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "lineOfBusiness": "AIR_TICKETS",
    "merchant": "TESTMERCHANT1",
    "order": {
      "amount": 82113.13,
      "chargeback": {
        "amount": 0,
        "currency": "GBP"
      },
      "creationTime": "2020-08-17T09:35:27.250Z",
      "currency": "GBP",
      "id": "992608474",
      "lastUpdatedTime": "2020-08-17T09:36:04.146Z",
      "merchantAmount": 82113.13,
      "merchantCurrency": "GBP",
      "reference": "TEST-SUCCEED",
      "status": "INITIATED",
      "totalAuthorizedAmount": 0,
      "totalCapturedAmount": 0,
      "totalRefundedAmount": 0
    },
    "response": {
      "gatewayCode": "SUBMITTED"
    },
    "result": "SUCCESS",
    "shipping": {
      "address": {
        "city": "Shipsville",
        "country": "GBR",
        "postcodeZip": "EH67DX",
        "stateProvince": "Scotland",
        "street": "2ShippingHeights",
        "street2": "ShipsDrive"
      },
      "contact": {
        "email": "John@gmail.com",
        "firstName": "John",
        "lastName": "Doe"
      }
    },
    "sourceOfFunds": {
      "provided": {
        "openBankingBankTransfer": {
          "aspspId": "12345XXX-XXXX-4156-XXXX-f6eeef0478cf"
        }
      },
      "type": "OPEN_BANKING_BANK_TRANSFER"
    },
    "timeOfLastUpdate": "2020-08-17T09:36:04.146Z",
    "timeOfRecord": "2020-08-17T09:35:27.270Z",
    "transaction": {
      "acquirer": {
        "id": "OPEN_BANKING",
        "merchantId": "MID"
      },
      "amount": 82113.13,
      "currency": "GBP",
      "id": "106172951",
      "receipt": "162c0482b774b3e1",
      "source": "INTERNET",
      "stan": "0",
      "type": "PAYMENT"
    },
    "version": "100"
  }
}
```

#### Sample Retrieve Transaction Response for an Approved Open Banking Interaction {#sample-retrieve-transaction-response-for-an-approved-open-banking-interaction}

Here is an example of a Retrieve Transaction response showing an approved Open Banking interaction (response.gatewayCode = APPROVED)

```json
{
  "amount": 123.46,
  "chargeback": {
    "amount": 0,
    "currency": "GBP"
  },
  "creationTime": "2020-06-24T01:01:09.584Z",
  "currency": "GBP",
  "device": {
    "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
  },
  "id": "86f293d3-1eb5-4003-9f30-7d9fbe7f1384",
  "item": [
    {
      "brand": "MC",
      "category": "NA",
      "detail": {
        "unitDiscountRate": 0,
        "unitTaxRate": 0
      },
      "name": "item0",
      "quantity": 1,
      "sku": "sku",
      "unitDiscountAmount": 3,
      "unitPrice": 21,
      "unitTaxAmount": 0.47
    },
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "item1",
      "quantity": 2,
      "unitDiscountAmount": 2,
      "unitPrice": 47,
      "unitTaxAmount": 5
    }
  ],
  "itemAmount": 115,
  "lastUpdatedTime": "2020-06-24T01:01:46.769Z",
  "merchant": "TESTMERCHANT1",
  "merchantAmount": 123.46,
  "merchantCurrency": "GBP",
  "reference": "sample",
  "result": "SUCCESS",
  "risk": {
    "response": {
      "gatewayCode": "ACCEPTED"
    }
  },
  "shipping": {
    "address": {
      "city": "London",
      "company": "ABC",
      "country": "GBR",
      "postcodeZip": "90001",
      "stateProvince": "ENG",
      "street": "2nd Main",
      "street2": "lane 2"
    },
    "contact": {
      "email": "John@gmail.com",
      "firstName": "John",
      "lastName": "Doe",
      "mobilePhone": "9999999999",
      "phone": "9999999999"
    },
    "method": "SAME_DAY"
  },
  "shippingAndHandlingAmount": 4.99,
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "status": "CAPTURED",
  "taxAmount": 10.47,
  "totalAuthorizedAmount": 123.46,
  "totalCapturedAmount": 123.46,
  "totalRefundedAmount": 0,
  "transaction": {
    "browserPayment": {
      "interaction": {
        "status": "COMPLETED",
        "timeCompleted": "2020-06-24T01:01:10.007Z",
        "timeInitiated": "2020-06-24T01:01:09.599Z",
        "timeRedirected": "2020-06-24T01:01:09.705Z",
        "timeReturned": "2020-06-24T01:01:09.991Z"
      },
      "operation": "PAY",
      "redirectUrl": "<hostname>/bpui/ob/out/BP-9099d773edb0e2d3d1e86c4bd9d9b867",
      "returnUrl": "<hostname>/api/documentation/integrationGuidelines/index.html"
    },
    "device": {
      "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    },
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "TESTMERCHANT1",
    "order": {
      "amount": 123.46,
      "chargeback": {
        "amount": 0,
        "currency": "GBP"
      },
      "creationTime": "2020-06-24T01:01:09.584Z",
      "currency": "GBP",
      "id": "86f293d3-1eb5-4003-9f30-7d9fbe7f1384",
      "item": [
        {
          "brand": "MC",
          "category": "NA",
          "detail": {
            "unitDiscountRate": 0,
            "unitTaxRate": 0
          },
          "name": "item0",
          "quantity": 1,
          "sku": "sku",
          "unitDiscountAmount": 3,
          "unitPrice": 21,
          "unitTaxAmount": 0.47
        },
        {
          "detail": {
            "unitTaxRate": 0
          },
          "name": "item1",
          "quantity": 2,
          "unitDiscountAmount": 2,
          "unitPrice": 47,
          "unitTaxAmount": 5
        }
      ],
      "itemAmount": 115,
      "lastUpdatedTime": "2020-06-24T01:01:46.769Z",
      "merchantAmount": 123.46,
      "merchantCurrency": "GBP",
      "reference": "sample",
      "shippingAndHandlingAmount": 4.99,
      "status": "CAPTURED",
      "taxAmount": 10.47,
      "totalAuthorizedAmount": 123.46,
      "totalCapturedAmount": 123.46,
      "totalRefundedAmount": 0
    },
    "response": {
      "gatewayCode": "APPROVED"
    },
    "result": "SUCCESS",
    "risk": {
      "response": {
        "gatewayCode": "ACCEPTED"
      }
    },
    "shipping": {
      "address": {
        "city": "London",
        "company": "ABC",
        "country": "GBR",
        "postcodeZip": "90001",
        "stateProvince": "ENG",
        "street": "2nd Main",
        "street2": "lane 2"
      },
      "contact": {
        "email": "John@gmail.com",
        "firstName": "John",
        "lastName": "Doe",
        "mobilePhone": "9999999999",
        "phone": "9999999999"
      },
      "method": "SAME_DAY"
    },
    "sourceOfFunds": {
      "provided": {
        "openBankingBankTransfer": {
          "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
        }
      },
      "type": "OPEN_BANKING_BANK_TRANSFER"
    },
    "timeOfLastUpdate": "2020-06-24T01:01:46.769Z",
    "timeOfRecord": "2020-06-24T01:01:09.596Z",
    "transaction": {
      "acquirer": {
        "id": "OPEN_BANKING",
        "merchantId": "MID"
      },
      "amount": 123.46,
      "currency": "GBP",
      "id": "1",
      "reference": "sample",
      "source": "INTERNET",
      "stan": "0",
      "type": "PAYMENT"
    },
    "version": "100"
  }
}
```

#### Sample Retrieve Transaction Response for a Pending Open Banking Interaction {#sample-retrieve-transaction-response-for-a-pending-open-banking-interaction}

Here is an example of a Retrieve Transaction response showing a pending Open Banking interaction (response.gatewayCode = PENDING)

```json
{
  "amount": 123.46,
  "chargeback": {
    "amount": 0,
    "currency": "GBP"
  },
  "creationTime": "2020-06-26T07:09:16.846Z",
  "currency": "GBP",
  "customer": {
    "email": "johmith@example.com"
  },
  "device": {
    "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
  },
  "id": "888190454",
  "item": [
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "Spud",
      "quantity": 1,
      "unitDiscountAmount": 3,
      "unitPrice": 21,
      "unitTaxAmount": 0.47
    },
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "item2",
      "quantity": 2,
      "unitDiscountAmount": 2,
      "unitPrice": 47,
      "unitTaxAmount": 5
    }
  ],
  "itemAmount": 115,
  "lastUpdatedTime": "2020-06-26T07:10:57.230Z",
  "merchant": "TESTMERCHANT1",
  "merchantAmount": 123.46,
  "merchantCurrency": "GBP",
  "reference": "TEST-SUCCEED",
  "result": "SUCCESS",
  "risk": {
    "response": {
      "gatewayCode": "ACCEPTED"
    }
  },
  "shipping": {
    "address": {
      "city": "Shipsville",
      "country": "GBR",
      "postcodeZip": "EH67DX",
      "stateProvince": "Scotland",
      "street": "2ShippingHeights",
      "street2": "ShipsDrive"
    },
    "contact": {
      "email": "johnsmith@example.com",
      "firstName": "Shipfirst",
      "lastName": "McShiplast"
    }
  },
  "shippingAndHandlingAmount": 4.99,
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "status": "CAPTURED",
  "taxAmount": 10.47,
  "totalAuthorizedAmount": 123.46,
  "totalCapturedAmount": 123.46,
  "totalRefundedAmount": 0,
  "transaction": [
    {
      "browserPayment": {
        "interaction": {
          "status": "RETURNED_TO_MERCHANT",
          "timeInitiated": "2020-06-26T07:09:16.864Z",
          "timeRedirected": "2020-06-26T07:10:53.329Z",
          "timeReturned": "2020-06-26T07:11:03.827Z"
        },
        "operation": "PAY",
        "redirectUrl": "<hostname>/bpui/ob/out/BP-65318d39a0c3b8000f07b7939561b819",
        "returnUrl": "<hostname>/apmDemoApp/complete.html"
      },
      "customer": {
        "email": "johmith@example.com"
      },
      "device": {
        "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
      },
      "gatewayEntryPoint": "WEB_SERVICES_API",
      "merchant": "TESTMERCHANT1",
      "order": {
        "amount": 123.46,
        "chargeback": {
          "amount": 0,
          "currency": "GBP"
        },
        "creationTime": "2020-06-26T07:09:16.846Z",
        "currency": "GBP",
        "id": "888190454",
        "item": [
          {
            "detail": {
              "unitTaxRate": 0
            },
            "name": "Spud",
            "quantity": 1,
            "unitDiscountAmount": 3,
            "unitPrice": 21,
            "unitTaxAmount": 0.47
          },
          {
            "detail": {
              "unitTaxRate": 0
            },
            "name": "item2",
            "quantity": 2,
            "unitDiscountAmount": 2,
            "unitPrice": 47,
            "unitTaxAmount": 5
          }
        ],
        "itemAmount": 115,
        "lastUpdatedTime": "2020-06-26T07:10:57.230Z",
        "merchantAmount": 123.46,
        "merchantCurrency": "GBP",
        "reference": "TEST-SUCCEED",
        "shippingAndHandlingAmount": 4.99,
        "status": "CAPTURED",
        "taxAmount": 10.47,
        "totalAuthorizedAmount": 123.46,
        "totalCapturedAmount": 123.46,
        "totalRefundedAmount": 0
      },
      "response": {
        "gatewayCode": "PENDING"
      },
      "result": "PENDING",
      "risk": {
        "response": {
          "gatewayCode": "ACCEPTED"
        }
      },
      "shipping": {
        "address": {
          "city": "Shipsville",
          "country": "GBR",
          "postcodeZip": "EH67DX",
          "stateProvince": "Scotland",
          "street": "2ShippingHeights",
          "street2": "ShipsDrive"
        },
        "contact": {
          "email": "johnsmith@example.com",
          "firstName": "Shipfirst",
          "lastName": "McShiplast"
        }
      },
      "sourceOfFunds": {
        "provided": {
          "openBankingBankTransfer": {
            "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
          }
        },
        "type": "OPEN_BANKING_BANK_TRANSFER"
      },
      "timeOfLastUpdate": "2020-06-26T07:10:57.230Z",
      "timeOfRecord": "2020-06-26T07:09:16.861Z",
      "transaction": {
        "acquirer": {
          "id": "OPEN_BANKING",
          "merchantId": "MID"
        },
        "amount": 123.46,
        "currency": "GBP",
        "id": "148341288",
        "source": "INTERNET",
        "stan": "0",
        "type": "PAYMENT"
      },
      "version": "100"
    }
  ]
}
```

#### Sample Retrieve Transaction Response for an Unsupported Open Banking Interaction {#sample-retrieve-transaction-response-for-an-unsupported-open-banking-interaction}

Here is an example of a Retrieve Transaction response showing an Open Banking interaction where response.gatewayCode = NOT_SUPPORTED

```json
{
  "amount": 123.46,
  "chargeback": {
    "amount": 0,
    "currency": "GBP"
  },
  "creationTime": "2020-06-11T07:04:16.222Z",
  "currency": "GBP",
  "device": {
    "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
  },
  "id": "575d3ae0-2b28-4a68-892e-688ae7e3d344",
  "item": [
    {
      "brand": "MC",
      "category": "NA",
      "detail": {
        "unitDiscountRate": 0,
        "unitTaxRate": 0
      },
      "name": "item0",
      "quantity": 1,
      "sku": "sku",
      "unitDiscountAmount": 3,
      "unitPrice": 21,
      "unitTaxAmount": 0.47
    },
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "item1",
      "quantity": 2,
      "unitDiscountAmount": 2,
      "unitPrice": 47,
      "unitTaxAmount": 5
    }
  ],
  "itemAmount": 115,
  "lastUpdatedTime": "2020-06-11T07:04:03.364Z",
  "merchant": "TESTMERCHANT1",
  "merchantAmount": 123.46,
  "merchantCurrency": "GBP",
  "reference": "sample",
  "result": "SUCCESS",
  "risk": {
    "response": {
      "gatewayCode": "ACCEPTED"
    }
  },
  "shipping": {
    "address": {
      "city": "London",
      "company": "ABC",
      "country": "GBR",
      "postcodeZip": "90001",
      "stateProvince": "ENG",
      "street": "2nd Main",
      "street2": "lane 2"
    },
    "contact": {
      "email": "John@gmail.com",
      "firstName": "John",
      "lastName": "Doe",
      "mobilePhone": "9999999999",
      "phone": "9999999999"
    },
    "method": "SAME_DAY"
  },
  "shippingAndHandlingAmount": 4.99,
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "status": "FAILED",
  "taxAmount": 10.47,
  "totalAuthorizedAmount": 0,
  "totalCapturedAmount": 0,
  "totalRefundedAmount": 0,
  "transaction": {
    "browserPayment": {
      "interaction": {
        "status": "COMPLETED",
        "timeCompleted": "2020-06-11T07:04:16.708Z",
        "timeInitiated": "2020-06-11T07:04:16.234Z",
        "timeRedirected": "2020-06-11T07:04:15.257Z",
        "timeReturned": "2020-06-11T07:04:16.679Z"
      },
      "operation": "PAY",
      "redirectUrl": "<hostname>/bpui/ob/out/BP-bcd3a9b079f6a66581c3429dcbec386b",
      "returnUrl": "<hostname>/api/documentation/integrationGuidelines/index.html"
    },
    "device": {
      "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    },
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "TESTMERCHANT1",
    "order": {
      "amount": 123.46,
      "chargeback": {
        "amount": 0,
        "currency": "GBP"
      },
      "creationTime": "2020-06-11T07:04:16.222Z",
      "currency": "GBP",
      "id": "575d3ae0-2b28-4a68-892e-688ae7e3d344",
      "item": [
        {
          "brand": "MC",
          "category": "NA",
          "detail": {
            "unitDiscountRate": 0,
            "unitTaxRate": 0
          },
          "name": "item0",
          "quantity": 1,
          "sku": "sku",
          "unitDiscountAmount": 3,
          "unitPrice": 21,
          "unitTaxAmount": 0.47
        },
        {
          "detail": {
            "unitTaxRate": 0
          },
          "name": "item1",
          "quantity": 2,
          "unitDiscountAmount": 2,
          "unitPrice": 47,
          "unitTaxAmount": 5
        }
      ],
      "itemAmount": 115,
      "lastUpdatedTime": "2020-06-11T07:04:03.364Z",
      "merchantAmount": 123.46,
      "merchantCurrency": "GBP",
      "reference": "sample",
      "shippingAndHandlingAmount": 4.99,
      "status": "FAILED",
      "taxAmount": 10.47,
      "totalAuthorizedAmount": 0,
      "totalCapturedAmount": 0,
      "totalRefundedAmount": 0
    },
    "response": {
      "gatewayCode": "NOT_SUPPORTED"
    },
    "result": "FAILURE",
    "risk": {
      "response": {
        "gatewayCode": "ACCEPTED"
      }
    },
    "shipping": {
      "address": {
        "city": "London",
        "company": "ABC",
        "country": "GBR",
        "postcodeZip": "90001",
        "stateProvince": "ENG",
        "street": "2nd Main",
        "street2": "lane 2"
      },
      "contact": {
        "email": "John@gmail.com",
        "firstName": "John",
        "lastName": "Doe",
        "mobilePhone": "9999999999",
        "phone": "9999999999"
      },
      "method": "SAME_DAY"
    },
    "sourceOfFunds": {
      "provided": {
        "openBankingBankTransfer": {
          "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
        }
      },
      "type": "OPEN_BANKING_BANK_TRANSFER"
    },
    "timeOfLastUpdate": "2020-06-11T07:04:03.364Z",
    "timeOfRecord": "2020-06-11T07:04:16.232Z",
    "transaction": {
      "acquirer": {
        "id": "OPEN_BANKING",
        "merchantId": "MID"
      },
      "amount": 123.46,
      "currency": "GBP",
      "id": "1",
      "reference": "sample",
      "source": "INTERNET",
      "stan": "0",
      "type": "PAYMENT"
    },
    "version": "100"
  }
}
```

#### Sample Retrieve Transaction Response for a Timed Out Open Banking Interaction {#sample-retrieve-transaction-response-for-a-timed-out-open-banking-interaction}

Here is an example of a Retrieve Transaction response showing a timed out Open Banking interaction (response.gatewayCode = TIMED_OUT)

```json
{
  "amount": 123.46,
  "chargeback": {
    "amount": 0,
    "currency": "GBP"
  },
  "creationTime": "2020-06-26T07:17:48.608Z",
  "currency": "GBP",
  "customer": {
    "email": "johmith@example.com"
  },
  "device": {
    "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
  },
  "id": "246119218",
  "item": [
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "Spud",
      "quantity": 1,
      "unitDiscountAmount": 3,
      "unitPrice": 21,
      "unitTaxAmount": 0.47
    },
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "item2",
      "quantity": 2,
      "unitDiscountAmount": 2,
      "unitPrice": 47,
      "unitTaxAmount": 5
    }
  ],
  "itemAmount": 115,
  "lastUpdatedTime": "2020-06-26T07:18:27.894Z",
  "merchant": "TESTMERCHANT1",
  "merchantAmount": 123.46,
  "merchantCurrency": "GBP",
  "reference": "TEST-SUCCEED",
  "result": "SUCCESS",
  "risk": {
    "response": {
      "gatewayCode": "ACCEPTED"
    }
  },
  "shipping": {
    "address": {
      "city": "Shipsville",
      "country": "GBR",
      "postcodeZip": "EH67DX",
      "stateProvince": "Scotland",
      "street": "2ShippingHeights",
      "street2": "ShipsDrive"
    },
    "contact": {
      "email": "johnsmith@example.com",
      "firstName": "Shipfirst",
      "lastName": "McShiplast"
    }
  },
  "shippingAndHandlingAmount": 4.99,
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "status": "FAILED",
  "taxAmount": 10.47,
  "totalAuthorizedAmount": 0,
  "totalCapturedAmount": 0,
  "totalRefundedAmount": 0,
  "transaction": {
    "browserPayment": {
      "interaction": {
        "status": "COMPLETED",
        "timeCompleted": "2020-06-26T07:18:39.485Z",
        "timeInitiated": "2020-06-26T07:17:49.654Z",
        "timeRedirected": "2020-06-26T07:18:18.595Z",
        "timeReturned": "2020-06-26T07:18:39.439Z"
      },
      "operation": "PAY",
      "redirectUrl": "<hostname>/bpui/ob/out/BP-bd0d14660fc5bd0a98578a73e83713cd",
      "returnUrl": "<hostname>/apmDemoApp/complete.html"
    },
    "customer": {
      "email": "johmith@example.com"
    },
    "device": {
      "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36"
    },
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "TESTMERCHANT1",
    "order": {
      "amount": 123.46,
      "chargeback": {
        "amount": 0,
        "currency": "GBP"
      },
      "creationTime": "2020-06-26T07:17:48.608Z",
      "currency": "GBP",
      "id": "246119218",
      "item": [
        {
          "detail": {
            "unitTaxRate": 0
          },
          "name": "Spud",
          "quantity": 1,
          "unitDiscountAmount": 3,
          "unitPrice": 21,
          "unitTaxAmount": 0.47
        },
        {
          "detail": {
            "unitTaxRate": 0
          },
          "name": "item2",
          "quantity": 2,
          "unitDiscountAmount": 2,
          "unitPrice": 47,
          "unitTaxAmount": 5
        }
      ],
      "itemAmount": 115,
      "lastUpdatedTime": "2020-06-26T07:18:27.894Z",
      "merchantAmount": 123.46,
      "merchantCurrency": "GBP",
      "reference": "TEST-SUCCEED",
      "shippingAndHandlingAmount": 4.99,
      "status": "FAILED",
      "taxAmount": 10.47,
      "totalAuthorizedAmount": 0,
      "totalCapturedAmount": 0,
      "totalRefundedAmount": 0
    },
    "response": {
      "gatewayCode": "TIMED_OUT"
    },
    "result": "FAILURE",
    "risk": {
      "response": {
        "gatewayCode": "ACCEPTED"
      }
    },
    "shipping": {
      "address": {
        "city": "Shipsville",
        "country": "GBR",
        "postcodeZip": "EH67DX",
        "stateProvince": "Scotland",
        "street": "2ShippingHeights",
        "street2": "ShipsDrive"
      },
      "contact": {
        "email": "johnsmith@example.com",
        "firstName": "Shipfirst",
        "lastName": "McShiplast"
      }
    },
    "sourceOfFunds": {
      "provided": {
        "openBankingBankTransfer": {
          "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
        }
      },
      "type": "OPEN_BANKING_BANK_TRANSFER"
    },
    "timeOfLastUpdate": "2020-06-26T07:18:27.894Z",
    "timeOfRecord": "2020-06-26T07:17:49.641Z",
    "transaction": {
      "acquirer": {
        "id": "OPEN_BANKING",
        "merchantId": "MID"
      },
      "amount": 123.46,
      "currency": "GBP",
      "id": "354434408",
      "source": "INTERNET",
      "stan": "0",
      "type": "PAYMENT"
    },
    "version": "100"
  }
}
```

#### Sample Retrieve Transaction Response for an Open Banking Interaction Where Funds are Insufficient {#sample-retrieve-transaction-response-for-an-open-banking-interaction-where-funds-are-insufficient}

Here is an example of a Retrieve Transaction response showing an Open Banking interaction where response.gatewayCode = INSUFFICIENT_FUNDS

```json
{
  "amount": 123.46,
  "chargeback": {
    "amount": 0,
    "currency": "GBP"
  },
  "creationTime": "2020-06-11T07:04:25.661Z",
  "currency": "GBP",
  "device": {
    "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
  },
  "id": "38de9737-f394-484e-86ce-a6df45416a61",
  "item": [
    {
      "brand": "MC",
      "category": "NA",
      "detail": {
        "unitDiscountRate": 0,
        "unitTaxRate": 0
      },
      "name": "item0",
      "quantity": 1,
      "sku": "sku",
      "unitDiscountAmount": 3,
      "unitPrice": 21,
      "unitTaxAmount": 0.47
    },
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "item1",
      "quantity": 2,
      "unitDiscountAmount": 2,
      "unitPrice": 47,
      "unitTaxAmount": 5
    }
  ],
  "itemAmount": 115,
  "lastUpdatedTime": "2020-06-11T07:04:13.889Z",
  "merchant": "TESTMERCHANT1",
  "merchantAmount": 123.46,
  "merchantCurrency": "GBP",
  "reference": "sample",
  "result": "SUCCESS",
  "risk": {
    "response": {
      "gatewayCode": "ACCEPTED"
    }
  },
  "shipping": {
    "address": {
      "city": "London",
      "company": "ABC",
      "country": "GBR",
      "postcodeZip": "90001",
      "stateProvince": "ENG",
      "street": "2nd Main",
      "street2": "lane 2"
    },
    "contact": {
      "email": "John@gmail.com",
      "firstName": "John",
      "lastName": "Doe",
      "mobilePhone": "9999999999",
      "phone": "9999999999"
    },
    "method": "SAME_DAY"
  },
  "shippingAndHandlingAmount": 4.99,
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "status": "FAILED",
  "taxAmount": 10.47,
  "totalAuthorizedAmount": 0,
  "totalCapturedAmount": 0,
  "totalRefundedAmount": 0,
  "transaction": {
    "browserPayment": {
      "interaction": {
        "status": "COMPLETED",
        "timeCompleted": "2020-06-11T07:04:26.110Z",
        "timeInitiated": "2020-06-11T07:04:25.673Z",
        "timeRedirected": "2020-06-11T07:04:25.798Z",
        "timeReturned": "2020-06-11T07:04:26.079Z"
      },
      "operation": "PAY",
      "redirectUrl": "<hostname>/bpui/ob/out/BP-dc04c5638e296c6fc3b2905a0607bbf9",
      "returnUrl": "<hostname>/api/documentation/integrationGuidelines/index.html"
    },
    "device": {
      "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    },
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "TESTMERCHANT1",
    "order": {
      "amount": 123.46,
      "chargeback": {
        "amount": 0,
        "currency": "GBP"
      },
      "creationTime": "2020-06-11T07:04:25.661Z",
      "currency": "GBP",
      "id": "38de9737-f394-484e-86ce-a6df45416a61",
      "item": [
        {
          "brand": "MC",
          "category": "NA",
          "detail": {
            "unitDiscountRate": 0,
            "unitTaxRate": 0
          },
          "name": "item0",
          "quantity": 1,
          "sku": "sku",
          "unitDiscountAmount": 3,
          "unitPrice": 21,
          "unitTaxAmount": 0.47
        },
        {
          "detail": {
            "unitTaxRate": 0
          },
          "name": "item1",
          "quantity": 2,
          "unitDiscountAmount": 2,
          "unitPrice": 47,
          "unitTaxAmount": 5
        }
      ],
      "itemAmount": 115,
      "lastUpdatedTime": "2020-06-11T07:04:13.889Z",
      "merchantAmount": 123.46,
      "merchantCurrency": "GBP",
      "reference": "sample",
      "shippingAndHandlingAmount": 4.99,
      "status": "FAILED",
      "taxAmount": 10.47,
      "totalAuthorizedAmount": 0,
      "totalCapturedAmount": 0,
      "totalRefundedAmount": 0
    },
    "response": {
      "gatewayCode": "INSUFFICIENT_FUNDS"
    },
    "result": "FAILURE",
    "risk": {
      "response": {
        "gatewayCode": "ACCEPTED"
      }
    },
    "shipping": {
      "address": {
        "city": "London",
        "company": "ABC",
        "country": "GBR",
        "postcodeZip": "90001",
        "stateProvince": "ENG",
        "street": "2nd Main",
        "street2": "lane 2"
      },
      "contact": {
        "email": "John@gmail.com",
        "firstName": "John",
        "lastName": "Doe",
        "mobilePhone": "9999999999",
        "phone": "9999999999"
      },
      "method": "SAME_DAY"
    },
    "sourceOfFunds": {
      "provided": {
        "openBankingBankTransfer": {
          "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
        }
      },
      "type": "OPEN_BANKING_BANK_TRANSFER"
    },
    "timeOfLastUpdate": "2020-06-11T07:04:13.889Z",
    "timeOfRecord": "2020-06-11T07:04:25.670Z",
    "transaction": {
      "acquirer": {
        "id": "OPEN_BANKING",
        "merchantId": "MID"
      },
      "amount": 123.46,
      "currency": "GBP",
      "id": "1",
      "reference": "sample",
      "source": "INTERNET",
      "stan": "0",
      "type": "PAYMENT"
    },
    "version": "100"
  }
}
```

#### Sample Retrieve Transaction Response for a Declined Open Banking Interaction {#sample-retrieve-transaction-response-for-a-declined-open-banking-interaction}

Here is an example of a Retrieve Transaction response showing a declined Open Banking interaction where response.gatewayCode = DECLINED

```json
{
  "amount": 123.46,
  "chargeback": {
    "amount": 0,
    "currency": "GBP"
  },
  "creationTime": "2020-06-11T07:06:37.862Z",
  "currency": "GBP",
  "device": {
    "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
  },
  "id": "800b8d34-770d-4135-a1a4-0afe64c96352",
  "item": [
    {
      "brand": "MC",
      "category": "NA",
      "detail": {
        "unitDiscountRate": 0,
        "unitTaxRate": 0
      },
      "name": "item0",
      "quantity": 1,
      "sku": "sku",
      "unitDiscountAmount": 3,
      "unitPrice": 21,
      "unitTaxAmount": 0.47
    },
    {
      "detail": {
        "unitTaxRate": 0
      },
      "name": "item1",
      "quantity": 2,
      "unitDiscountAmount": 2,
      "unitPrice": 47,
      "unitTaxAmount": 5
    }
  ],
  "itemAmount": 115,
  "lastUpdatedTime": "2020-06-11T07:06:24.923Z",
  "merchant": "TESTMERCHANT1",
  "merchantAmount": 123.46,
  "merchantCurrency": "GBP",
  "reference": "sample",
  "result": "SUCCESS",
  "risk": {
    "response": {
      "gatewayCode": "ACCEPTED"
    }
  },
  "shipping": {
    "address": {
      "city": "London",
      "company": "ABC",
      "country": "GBR",
      "postcodeZip": "90001",
      "stateProvince": "ENG",
      "street": "2nd Main",
      "street2": "lane 2"
    },
    "contact": {
      "email": "John@gmail.com",
      "firstName": "John",
      "lastName": "Doe",
      "mobilePhone": "9999999999",
      "phone": "9999999999"
    },
    "method": "SAME_DAY"
  },
  "shippingAndHandlingAmount": 4.99,
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "status": "FAILED",
  "taxAmount": 10.47,
  "totalAuthorizedAmount": 0,
  "totalCapturedAmount": 0,
  "totalRefundedAmount": 0,
  "transaction": {
    "browserPayment": {
      "interaction": {
        "status": "COMPLETED",
        "timeCompleted": "2020-06-11T07:06:38.269Z",
        "timeInitiated": "2020-06-11T07:06:37.871Z",
        "timeRedirected": "2020-06-11T07:06:37.983Z",
        "timeReturned": "2020-06-11T07:06:38.241Z"
      },
      "operation": "PAY",
      "redirectUrl": "<hostname>/bpui/ob/out/BP-6c56d32fad0f0f11df57409b9728cb5c",
      "returnUrl": "<hostname>/api/documentation/integrationGuidelines/index.html"
    },
    "device": {
      "browser": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
    },
    "gatewayEntryPoint": "WEB_SERVICES_API",
    "merchant": "TESTMERCHANT1",
    "order": {
      "amount": 123.46,
      "chargeback": {
        "amount": 0,
        "currency": "GBP"
      },
      "creationTime": "2020-06-11T07:06:37.862Z",
      "currency": "GBP",
      "id": "800b8d34-770d-4135-a1a4-0afe64c96352",
      "item": [
        {
          "brand": "MC",
          "category": "NA",
          "detail": {
            "unitDiscountRate": 0,
            "unitTaxRate": 0
          },
          "name": "item0",
          "quantity": 1,
          "sku": "sku",
          "unitDiscountAmount": 3,
          "unitPrice": 21,
          "unitTaxAmount": 0.47
        },
        {
          "detail": {
            "unitTaxRate": 0
          },
          "name": "item1",
          "quantity": 2,
          "unitDiscountAmount": 2,
          "unitPrice": 47,
          "unitTaxAmount": 5
        }
      ],
      "itemAmount": 115,
      "lastUpdatedTime": "2020-06-11T07:06:24.923Z",
      "merchantAmount": 123.46,
      "merchantCurrency": "GBP",
      "reference": "sample",
      "shippingAndHandlingAmount": 4.99,
      "status": "FAILED",
      "taxAmount": 10.47,
      "totalAuthorizedAmount": 0,
      "totalCapturedAmount": 0,
      "totalRefundedAmount": 0
    },
    "response": {
      "gatewayCode": "DECLINED"
    },
    "result": "FAILURE",
    "risk": {
      "response": {
        "gatewayCode": "ACCEPTED"
      }
    },
    "shipping": {
      "address": {
        "city": "London",
        "company": "ABC",
        "country": "GBR",
        "postcodeZip": "90001",
        "stateProvince": "ENG",
        "street": "2nd Main",
        "street2": "lane 2"
      },
      "contact": {
        "email": "John@gmail.com",
        "firstName": "John",
        "lastName": "Doe",
        "mobilePhone": "9999999999",
        "phone": "9999999999"
      },
      "method": "SAME_DAY"
    },
    "sourceOfFunds": {
      "provided": {
        "openBankingBankTransfer": {
          "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
        }
      },
      "type": "OPEN_BANKING_BANK_TRANSFER"
    },
    "timeOfLastUpdate": "2020-06-11T07:06:24.923Z",
    "timeOfRecord": "2020-06-11T07:06:37.869Z",
    "transaction": {
      "acquirer": {
        "id": "OPEN_BANKING",
        "merchantId": "MID"
      },
      "amount": 123.46,
      "currency": "GBP",
      "id": "1",
      "reference": "sample",
      "source": "INTERNET",
      "stan": "0",
      "type": "PAYMENT"
    },
    "version": "100"
  }
}
```

#### Sample Retrieve Transaction Response for an Open Banking Interaction Where Authentication Failed {#sample-retrieve-transaction-response-for-an-open-banking-interaction-where-authentication-failed}

Here is an example of a Retrieve Transaction response showing an Open Banking interaction where response.gatewayCode = AUTHENTICATION_FAILED

```json
{
  "browserPayment": {
    "interaction": {
      "status": "COMPLETED",
      "timeInitiated": "2020-11-20T05:07:28.134Z",
      "timeRedirected": "2020-11-20T05:07:34.498Z",
      "timeReturned": "2020-11-20T05:07:43.449Z"
    },
    "operation": "PAY",
    "redirectUrl": "<hostname>/bpui/ob/out/BP-b37b6e71a76bfa5f3847349684297033",
    "returnUrl": "<hostname>/apmDemoApp/complete.html"
  },
  "customer": {
    "email": "John@example.com"
  },
  "device": {
    "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "TESTMERCHANT1",
  "order": {
    "amount": 85116.16,
    "chargeback": {
      "amount": 0,
      "currency": "GBP"
    },
    "creationTime": "2020-11-20T05:07:28.085Z",
    "currency": "GBP",
    "id": "408124232",
    "lastUpdatedTime": "2020-11-20T05:07:46.524Z",
    "merchantAmount": 85116.16,
    "merchantCurrency": "GBP",
    "reference": "TEST-SUCCEED",
    "status": "FAILED",
    "totalAuthorizedAmount": 0,
    "totalCapturedAmount": 0,
    "totalRefundedAmount": 0
  },
  "response": {
    "gatewayCode": "AUTHENTICATION_FAILED"
  },
  "result": "FAILURE",
  "shipping": {
    "address": {
      "city": "Shipsville",
      "country": "GBR",
      "postcodeZip": "EH67DX",
      "stateProvince": "Scotland",
      "street": "2ShippingHeights",
      "street2": "ShipsDrive"
    },
    "contact": {
      "email": "johnsmith@yahoo.com",
      "firstName": "Shipfirst",
      "lastName": "McShiplast"
    }
  },
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "timeOfLastUpdate": "2020-11-20T05:07:46.524Z",
  "timeOfRecord": "2020-11-20T05:07:28.130Z",
  "transaction": {
    "acquirer": {
      "id": "OPEN_BANKING",
      "merchantId": "MID"
    },
    "amount": 85116.16,
    "currency": "GBP",
    "id": "162988232",
    "receipt": "16491f04ec662b0a",
    "source": "INTERNET",
    "stan": "0",
    "type": "PAYMENT"
  },
  "version": "100"
}
```

#### Sample Retrieve Transaction Response for a Cancelled Open Banking Interaction {#sample-retrieve-transaction-response-for-a-cancelled-open-banking-interaction}

Here is an example of a Retrieve Transaction response showing an Open Banking interaction where response.gatewayCode = CANCELLED

```json
{
  "browserPayment": {
    "interaction": {
      "status": "COMPLETED",
      "timeInitiated": "2020-11-20T05:17:33.076Z",
      "timeRedirected": "2020-11-20T05:17:40.315Z",
      "timeReturned": "2020-11-20T05:17:47.612Z"
    },
    "operation": "PAY",
    "redirectUrl": "<hostname>/bpui/ob/out/BP-fdc97e608a425ec6cc535ae6a8dd9063",
    "returnUrl": "<hostname>/apmDemoApp/complete.html"
  },
  "customer": {
    "email": "John@example.com"
  },
  "device": {
    "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.193 Safari/537.36"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "TESTMERCHANT1",
  "order": {
    "amount": 86117.17,
    "chargeback": {
      "amount": 0,
      "currency": "GBP"
    },
    "creationTime": "2020-11-20T05:17:33.039Z",
    "currency": "GBP",
    "id": "849804618",
    "lastUpdatedTime": "2020-11-20T05:17:50.060Z",
    "merchantAmount": 86117.17,
    "merchantCurrency": "GBP",
    "reference": "TEST-SUCCEED",
    "status": "FAILED",
    "totalAuthorizedAmount": 0,
    "totalCapturedAmount": 0,
    "totalRefundedAmount": 0
  },
  "response": {
    "gatewayCode": "CANCELLED"
  },
  "result": "FAILURE",
  "shipping": {
    "address": {
      "city": "Shipsville",
      "country": "GBR",
      "postcodeZip": "EH67DX",
      "stateProvince": "Scotland",
      "street": "2ShippingHeights",
      "street2": "ShipsDrive"
    },
    "contact": {
      "email": "johnsmith@yahoo.com",
      "firstName": "Shipfirst",
      "lastName": "McShiplast"
    }
  },
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "123456-xxxx-4dd4-b4f2-12234vgb43bff"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "timeOfLastUpdate": "2020-11-20T05:17:50.060Z",
  "timeOfRecord": "2020-11-20T05:17:33.073Z",
  "transaction": {
    "acquirer": {
      "id": "OPEN_BANKING",
      "merchantId": "MID"
    },
    "amount": 86117.17,
    "currency": "GBP",
    "id": "921434587",
    "receipt": "16491f91c5986259",
    "source": "INTERNET",
    "stan": "0",
    "type": "PAYMENT"
  },
  "version": "100"
}
```

## Refunds {#refunds}

### Prerequisites {#prerequisites-1}

* To initiate a refund request, your payment service provider must configure you for the Refund privilege.
* To use refunds, use the JS-SDK version 1.3.0 that is supported from Mastercard Gateway API version 68.

Refunds are supported for only domestic transactions. You can submit the Refund requests either through the Refund operation or the Merchant Administration portal. For the Open Banking payments, you can partially or completely refund the processed payments for the captured transactions. The Open banking transfer payments do not support excessive refunds.

## Settlement Information {#settlement-information}

To view the details of the Open Banking Bank Transfer transaction settlement, retrieve the order/transaction details using [Retrieve Order](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction)/[Retrieve Transaction](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#transaction) operations, and check the `transaction.receipt` field for the reference number. The same reference number will be displayed to the payer on the payment receipt.

## Webhook notifications {#webhook-notifications}

Subscribing to Webhook notifications enables you to receive notifications on your system when a transaction for an order is created or updated in the gateway. This allows you to update your merchant system accordingly. The Webhook notification contains the response of the Retrieve Transaction operation.

### Webhook Notifications Details {#webhook-notifications-details}

#### Sample Webhook Response {#sample-webhook-response}

```json
{
  "browserPayment": {
    "interaction": {
      "status": "COMPLETED",
      "timeInitiated": "2021-02-18T10:59:26.772Z",
      "timeRedirected": "2021-02-18T10:59:31.236Z",
      "timeReturned": "2021-02-18T11:00:01.577Z"
    },
    "operation": "PAY",
    "redirectUrl": "{{host}}/bpui/ob/out/BP-5da80e52dd990b1970ae8bdfc6fddb36",
    "returnUrl": "https://prd-mastercard.airbakery.eu/Return.aspx"
  },
  "customer": {
    "email": "johnsmith@yahoo.com"
  },
  "device": {
    "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36 Edg/88.0.705.68",
    "ipAddress": "101.00.100.00"
  },
  "gatewayEntryPoint": "WEB_SERVICES_API",
  "merchant": "AIRBAKERY",
  "order": {
    "amount": 5.00,
    "chargeback": {
      "amount": 0,
      "currency": "GBP"
    },
    "creationTime": "2021-02-18T10:59:26.728Z",
    "currency": "GBP",
    "id": "TESTORD12345",
    "lastUpdatedTime": "2021-02-18T11:00:31.905Z",
    "merchantAmount": 5.00,
    "merchantCurrency": "GBP",
    "status": "CAPTURED",
    "totalAuthorizedAmount": 5.00,
    "totalCapturedAmount": 5.00,
    "totalRefundedAmount": 0
  },
  "response": {
    "gatewayCode": "APPROVED"
  },
  "result": "SUCCESS",
  "risk": {
    "response": {
      "gatewayCode": "ACCEPTED",
      "review": {
        "decision": "NOT_REQUIRED",
        "note": ""
      },
      "rule": [
        {
          "data": "100.00.100.01",
          "name": "MSO_IP_ADDRESS_RANGE",
          "recommendation": "NO_ACTION",
          "type": "MSO_RULE"
        },
        {
          "data": "GBR",
          "name": "MSO_IP_COUNTRY",
          "recommendation": "NO_ACTION",
          "type": "MSO_RULE"
        }
      ]
    }
  },
  "sourceOfFunds": {
    "provided": {
      "openBankingBankTransfer": {
        "aspspId": "12345-23abc-a2g-a8e7-5653886af4"
      }
    },
    "type": "OPEN_BANKING_BANK_TRANSFER"
  },
  "timeOfLastUpdate": "2021-02-18T11:00:31.905Z",
  "timeOfRecord": "2021-02-18T10:59:26.768Z",
  "transaction": {
    "acquirer": {
      "id": "OPEN_BANKING",
      "merchantId": "MID"
    },
    "amount": 5.00,
    "currency": "GBP",
    "id": "TESTTRX12345",
    "receipt": "52345667731732aa",
    "source": "INTERNET",
    "stan": "0",
    "type": "PAYMENT"
  },
  "version": "<latest_gateway_version>"
}
```

### Webhook Response Description {#webhook-response-description}

The following table provides a description about each element in the Webhook response.

|     **Item**      |                                                                                                                   **Description**                                                                                                                    |                                                                                                                                                                                                            **Values**                                                                                                                                                                                                            |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| BrowserPayment    | Information required by the gateway to manage interactions with a browser payment provider's website.                                                                                                                                                | -                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Interaction       | Provides details about the interaction of your system and the provider's system when initiating the browser payment, redirecting the customer's browser to the provider's system, back to the merchant's website and completing the browser payment. | -                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Status            | The status of the interaction between the merchant's system and the payment provider's system.                                                                                                                                                       | COMPLETED: This browser payment has been completed, in other words the gateway has been informed about the payment result. INITIATED: This browser payment has successfully been initiated. REDIRECTED_TO_PROVIDER: The payer's browser has been redirected to the payment provider's website. RETURNED_TO_MERCHANT: The payer's browser has been redirected back from the payment provider's website to the merchant's website. |
| Time Initiated    | The date and time the browser payment was initiated.                                                                                                                                                                                                 | Example: 2021-02-18T10:59:26.772Z                                                                                                                                                                                                                                                                                                                                                                                                |
| Time Redirected   | The date and time the customer's browser was redirected to the provider's website.                                                                                                                                                                   | Example: 2021-02-18T10:59:31.236Z                                                                                                                                                                                                                                                                                                                                                                                                |
| Time Returned     | The date and time the customer's browser was redirected back to the merchant's website.                                                                                                                                                              | Example: 2021-02-18T11:00:01.577Z                                                                                                                                                                                                                                                                                                                                                                                                |
| Operation         | The type of transaction created for this payment.                                                                                                                                                                                                    | PAY                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Redirect URL      | The URL within the merchant's website to which the payer's browser will be redirected when the payer chooses the "Open Banking Bank Transfer" payment method.                                                                                        | -                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Return URL        | The URL to which you want the payer's browser to be redirected after completing the payment at the provider's website.                                                                                                                               | -                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Customer          | Information about the customer, such as contact details and email address.                                                                                                                                                                           | -                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Email             | The email address of the customer.                                                                                                                                                                                                                   | Example: JohnDoe@yahoo.com                                                                                                                                                                                                                                                                                                                                                                                                       |
| Device            | Information about the device used by the payer for this transaction.                                                                                                                                                                                 | -                                                                                                                                                                                                                                                                                                                                                                                                                                |
| Browser           | The User-Agent header of the browser the customer used to place the order.                                                                                                                                                                           | Example: Mozilla/5.0 (Windows NT 10.0; Win64; x64)...                                                                                                                                                                                                                                                                                                                                                                            |
| IP Address        | The IP address of the device used by the payer.                                                                                                                                                                                                      | -                                                                                                                                                                                                                                                                                                                                                                                                                                |
| GatewayEntryPoint | The interface through which the transaction is submitted to the gateway.                                                                                                                                                                             | Defaults to "WEB_SERVICE_API"                                                                                                                                                                                                                                                                                                                                                                                                    |
| Merchant          | The unique identifier issued to you by your payment provider.                                                                                                                                                                                        | Merchant name                                                                                                                                                                                                                                                                                                                                                                                                                    |

## Testing Your Open Banking Bank Transfer Integration {#testing-your-open-banking-bank-transfer-integration}

The Mastercard Gateway provides an Open Banking Bank Transfer sample emulator that allows you to test your integration with a test bank and test amounts. Once you complete your integration with the Open Banking JavaScript SDK, you can perform test transactions using the test transaction amounts with Copernicium bank as shown in the table below. If you wish to proceed with Ozone Modelo Test Bank, select the scenario (success/failure) that you want to test using the options from the drop-down list on the screen.

|                    Scenario                    |  Transaction Amount   | Transaction Status  | Order Status |
|------------------------------------------------|-----------------------|---------------------|--------------|
| Success scenarios (default)                    | 80111.11 GBP          | SUBMITTED           | INITIATED    |
| Success scenarios (default)                    | 81112.12 GBP          | PENDING RESPONSE    | CAPTURED     |
| Success scenarios (default)                    | 92123.23 GBP          | APPROVED            | CAPTURED     |
| Failure scenarios (default)                    | 83114.14 GBP          | UNSPECIFIED FAILURE | FAILED       |
| Access denied 85116.16 GBP                     | AUTHENTICATION FAILED | FAILED              |              |
| Transaction Request Timeout                    | 84115.15 GBP          | TIMED OUT           | FAILED       |
| Transaction Cancelled                          | 86117.17 GBP          | CANCELLED           | FAILED       |
| Failure scenarios - payment processing timeout | 87118.18 GBP          | TIMED OUT           | FAILED       |
| Insufficient funds                             | 88119.19 GBP          | INSUFFICIENT FUNDS  | FAILED       |
| Invalid Amount                                 | 89120.20 GBP          | NOT SUPPORTED       | FAILED       |
| Invalid Currency                               | 89120.20 GBP          | NOT SUPPORTED       | FAILED       |

