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

PayU is an online bank transfer payment method. It allows payers to make payments directly from their bank account.

For the online real-time bank transfer purchases, payers

* select their preferred online bank
* log in to their account to review the payment details, and
* authorize the funds payment so that the funds are credited to the payee's account.

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 PayU integration.

## Prerequisites {#prerequisites}

To offer the PayU payment method through the Mastercard Gateway,

* Be registered with your browser payments service provider
* your merchant profile on the Mastercard Gateway must be configured using the details of your account with the browser payments service provider, and
* you must have a bank account in one of the supported currencies registered against your merchant account at your browser payments service provider.

## PayU transactions {#payu-transactions}

The PPRO acquirers support the PayU transactions that originate from the countries and the corresponding currencies mentioned in the following table.

|       Country        | Currency |
|----------------------|----------|
| Poland (POL)         | PLN      |
| Czech Republic (CZE) | CZK      |

## PayU integration {#payu-integration}

### PayU through Hosted Checkout {#payu-through-hosted-checkout}

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

From Mastercard Gateway API version 70 and later, PayU 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).

### PayU through Direct Payment {#payu-through-direct-payment}

Direct Payment integration allows you to offer the PayU payment method on your own checkout page.

Alert: PayU is supported from Mastercard Gateway API version 67 and later.

<br />

#### Common fields {#common-fields}

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 common fields in the [Initiate Browser Payment](https://developer.mastercard.com/mastercard-gateway/documentation/api-reference/v100/rest/api-ops/index.md#browser-payment) request:

* `sourceOfFunds.type`-PayU
* `browserPayment.operation`-PAY
* `sourceOfFunds.provided.payU.bankAccountHolder`-Name of the bank account holder for the payer's bank account. This is an optional field.
* `sourceOfFunds.provided.payU.bankAccountCountryCode`-The country where payers have their bank account. Provide the ISO 3166 alpha-3 country code for this country.

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

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

### Sample Code to initiate PayU Payment {#sample-code-to-initiate-payu-payment}

```json
{
  "apiOperation": "INITIATE_BROWSER_PAYMENT",
  "browserPayment": {
    "operation": "PAY",
    "returnUrl": "<your_merchant_URL>"
  },
  "customer": {
    "email": "john.smith@example.com"
  },
  "order": {
    "amount": "142.22",
    "currency": "CZK"
  },
  "sourceOfFunds": {
    "type": "PAYU",
    "provided": {
      "payU": {
        "bankAccountHolder": "Test accountHolder",
        "bankAccountCountryCode": "CZE"
      }
    }
  }
}
```

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

The following table specifies the transaction Response Codes for the possible scenarios that you may encounter after initiating the PayU 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`                            | 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 case of an `ACQUIRER_SYSTEM_ERROR`, you may want to inquire with the acquirer about the reason for the 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 to ensure that the transaction is not successful or will revert the transaction.                                                                                                      |

## Refunds {#refunds}

You can refund the PayU payments in installments or in full. Ensure that you are configured for refunds on the Mastercard Gateway and on your merchant account at your browser payments service provider.

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

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