# Multibanco
source: https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/alt-pay-methods/a2a/multibanco/index.md

Multibanco is a payment method that is used in Portugal. Multibanco enables consumers to pay for a range of goods or services that include e-commerce, licenses, and taxes either through bank transfer or through the Multibanco card at an ATM.

Multibanco is a supported browser payment method in the Mastercard Gateway. This page describes integration details specific to Multibanco. 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 the Multibanco integration.

Warning: Due to security reasons, the Multibanco reference is only valid for seven days after it is generated.

<br />

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

## Prerequisites {#prerequisites}

To offer Multibanco 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.

## Multibanco Integration {#multibanco-integration}

### Multibanco through Hosted Checkout {#multibanco-through-hosted-checkout}

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

From Mastercard Gateway API version 65 and later, Multibanco is automatically available as a payment method once your payment service provider enables and configures you for this payment method.

For details, see [Browser Payments through Hosted Checkout Integration](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/imp-brow-pay-int/index.md#browser-payments-through-hosted-checkout-integration).

### Multibanco through Direct Payment {#multibanco-through-direct-payment}

Direct Payment integration allows you to offer the Multibanco payment method on your own checkout page.
Alert: Multibanco is supported from Mastercard Gateway API version 65 and later.

Make an Initiate Browser Payment request where `sourceOfFunds.type` = MULTIBANCO and `browserPayment.operation` = PAY (the Authorize operation is not supported by Multibanco). For the standard fields, see [Browser Payments through Direct Payment Integration](https://developer.mastercard.com/mastercard-gateway/documentation/payment-methods/imp-brow-pay-int/index.md#browser-payments-through-direct-payment-integration).

The following fields are returned in the Initiate Browser Payment/Retrieve Transaction/Retrieve Order response after you initiate a Multibanco payment.

* `sourceOfFunds.provided.multibanco.entityId`: Your merchant identifier at Multibanco.
* `sourceOfFunds.provided.multibanco.paymentReference`: An identifier for the Multibanco payment. Provide these fields to your payer to complete the payment.

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

You can set the language that you prefer Multibanco 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 Multibanco supports it.

#### Sample Code to Initiate Multibanco Payment {#sample-code-to-initiate-multibanco-payment}

```json
{
  "apiOperation": "INITIATE_BROWSER_PAYMENT",
  "browserPayment": {
    "operation": "PAY",
    "returnUrl": "<your_merchant_URL>"
  },
  "order": {
    "amount": "10.00",
    "currency": "EUR"
  },
  "sourceOfFunds": {
    "type": "MULTIBANCO"
  }
}
```

## Refunds {#refunds}

You can refund Multibanco payments in part or in full. Be configured for refunds on the Mastercard Gateway and on your merchant account at your payment service provider.

## 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 Multibanco 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.multibanco.terminalLocation` `sourceOfFunds.provided.multibanco.terminalId` | 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 gateway will attempt to ensure that the transaction is not successful or will revert the transaction.                                                                                                          |

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

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