# SEPA
source: https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/alt-pay-methods/bank-transfer/sepa/index.md

SEPA is an e-commerce payment system used in the Eurozone that allows payers to purchase using direct debit payments from their bank account. Payers are redirected to PPRO, the payer accepts the mandate displayed on-screen, triggering a pre-notification of payment through e-mail and the payment debited from their account.

SEPA is a supported browser payment method in the Mastercard Gateway. This page describes integration details specific to SEPA. It is recommended that you read the [integration guidelines for browser payments](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/imp-brow-pay-int/index.md), before building a SEPA integration.

SEPA browser payments are only supported for transactions in the EUR currency.

Warning: SEPA Recurring is currently not supported.

<br />

## Prerequisites {#prerequisites}

To offer SEPA as a payment method through the Mastercard Gateway:

* Be registered with your browser payments service provider.
* Your merchant profile on the gateway must be configured using the details of your account with the browser payments service provider.
* You must have a bank account in one of the supported currencies registered against your merchant account at your browser payments service provider.

## SEPA Integration {#sepa-integration}

### SEPA through Hosted Checkout {#sepa-through-hosted-checkout}

SEPA through Hosted Checkout will be available soon. Contact your payment service provider for further information.

### SEPA through Direct Payment {#sepa-through-direct-payment}

Direct Payment integration allows you to offer a SEPA payment method on your own checkout page.

Alert: SEPA is supported from Mastercard Gateway API version 47 and later.

<br />

In addition to the [standard fields](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/imp-brow-pay-int/index.md#browser-payments-through-direct-payment-integration) required in a browser payment request, provide the following fields in the Initiate Browser Payment request:

* `sourceOfFunds.type` = SEPA
* `browserPayment.operation` = PAY (the Authorize operation is not supported by SEPA)
* `customer.email`: The email address of the payer.
* `sourceOfFunds.provided.sepa.bankAccountHolder`: The name of the bank account holder for the payer's bank account.
* `sourceOfFunds.provided.sepa.iban`: The International Bank Account Number (IBAN) for the payer's bank account.

##### Preferred Language {#preferred-language}

You can set the language that you prefer SEPA to use for pages displayed to the payer by providing the `browserPayment.preferredLanguage` field in the Initiate Browser Payment request. However, the language will be used only if SEPA supports it.

##### Chargebacks {#chargebacks}

SEPA payments are at risk of chargebacks. If a payer disputes a payment and successfully creates a chargeback through their bank, this event will be reflected in the gateway and the reason provided in the `transaction.dispute.reason` field.

### Sample Code to Initiate SEPA Payment {#sample-code-to-initiate-sepa-payment}

```json
{
  "apiOperation": "INITIATE_BROWSER_PAYMENT",
  "browserPayment": {
    "operation": "PAY",
    "returnUrl": "https://<return_url>"
  },
  "customer": {
    "email": "john.smith@example.com"
  },
  "order": {
    "amount": "10.00",
    "currency": "EUR"
  },
  "sourceOfFunds": {
    "type": "SEPA",
    "provided": {
      "sepa": {
        "iban": "GB33BUKB20201555555555",
        "bankAccountHolder": "John Smith"
      }
    }
  }
}
```

## How to Interpret the Transaction Result {#how-to-interpret-the-transaction-result}

The table below shows the transaction response codes for the possible scenarios that you may encounter after initiating a SEPA payment.

|                                                                 **Initiate Browser Payment Response**                                                                 |                                                                                                                **What This Means...**                                                                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `response.gatewayCode=SUBMITTED` `result=SUCCESS`                                                                                                                     | Redirect the payer using the URL provided in the response.                                                                                                                                                                                           |
| **Retrieve Transaction/Retrieve Order Response**                                                                                                                      | **What This Means...**                                                                                                                                                                                                                               |
| `response.gatewayCode=APPROVED` `result=SUCCESS` `sourceOfFunds.provided.sepa.bankAccountHolder` `sourceOfFunds.provided.sepa.iban` `sourceOfFunds.provided.sepa.bic` | The payment is successful.                                                                                                                                                                                                                           |
| `response.gatewayCode=PENDING` `result=PENDING`                                                                                                                       | The Mastercard Gateway is waiting for a notification from the acquirer about the payment result. Try `RETRIEVE_TRANSACTION` again later or listen to notifications from the Mastercard Gateway.                                                      |
| `response.gatewayCode=CANCELLED` `result=FAILURE`                                                                                                                     | The payer has canceled the interaction for this payment. Offer the payer the option to try another payment method.                                                                                                                                   |
| `response.gatewayCode=DECLINED or ACQUIRER_SYSTEM_ERROR` `result=FAILURE`                                                                                             | The payment was declined. Offer the payer the option to try another payment method. In the case of an `ACQUIRER_SYSTEM_ERROR` you may want to inquire with the acquirer the reason for payment failure, or you can try `RETRIEVE_TRANSACTION` again. |
| `response.gatewayCode=TIMED_OUT` `result=FAILURE`                                                                                                                     | Treat this as a declined payment. The Mastercard Gateway will attempt ensure that the transaction is not successful or will revert the transaction.                                                                                                  |

## Refunds {#refunds}

You can refund SEPA payments in part or in full. Be configured for refunds on the gateway and on your merchant account at your APM service provider.

## Testing your Integration {#testing-your-integration}

The Mastercard Gateway provides a browser payments emulator that allows you to \[test your SEPA integration\].
