# payu/magento24-payment-gateway

> Official PayU integration plugin for Magento 2.4

`composer require payu/magento24-payment-gateway`

Canonical URL: https://packagento.com/payu/magento24-payment-gateway

## At a glance

- **Vendor**: payu (https://packagento.com/payu.md)
- **Latest version**: 2.0.7 — released 2026-04-22
- **Pricing**: Free
- **Package type**: Magento 2 module
- **Status**: active, accepting new buyers

## Installation

Packagento is licence-gated, so even free packages need a licence on a project before Composer can resolve them.

1. **Sign in or create an account** at https://packagento.com/customer/account/.

2. **Add the package to your account.** Open https://packagento.com/payu/magento24-payment-gateway and complete the free checkout. A licence is minted automatically.

3. **Create or pick a project, then activate the licence on it.**
   - Projects represent the Magento installs you deploy to. Manage them at https://packagento.com/projects/.
   - Activate the new licence on the project you'll deploy this package to. Activation is what generates the Composer credentials scoped to that project.

4. **Add the project credentials to your Magento codebase.**

   Grab the project's public + private key from https://packagento.com/projects/ (open the project, then its Credentials tab), and add them to `auth.json`:

   ```json
   {
     "http-basic": {
       "packagento.com": {
         "username": "ppk_live_...",
         "password": "psk_live_..."
       }
     }
   }
   ```

   Add the Packagento Composer repository to `composer.json`:

   ```json
   {
     "repositories": [
       { "type": "composer", "url": "https://packagento.com" }
     ]
   }
   ```

5. **Install and apply.**

   ```bash
   composer require payu/magento24-payment-gateway:*
   bin/magento setup:upgrade
   bin/magento setup:di:compile
   bin/magento cache:flush
   ```

## What it does

Official PayU integration plugin for Magento 2.4

## README

[**English version**][ext8]

## Moduł PayU dla Magento 2 w wersji 2.4

### UWAGA
**W związku ze zmianami opisanymy w [CHANGELOG][ext10] po aktualizacji wtyczki z wersji 1.X na 2.X należy wykonać ponowną konfigurację wtyczki.**

**Jeżeli masz jakiekolwiek pytania lub chcesz zgłosić błąd zapraszamy do kontaktu z naszym wsparciem pod adresem: tech@payu.pl.**

* Jeżeli używasz Magento w wersji 1.x proszę skorzystać z [pluginu dla wersji 1.x][ext0]
* Jeżeli używasz Magento w wersji >2.0.6, 2.1, 2.2 proszę skorzystać z [pluginu dla wersji >2.0.6, 2.1, 2.2][ext7]
* Jeżeli używasz Magento w wersji 2.3 proszę skorzystać z [pluginu dla wersji 2.3][ext9]

### Spis treści

1. [Cechy](#cechy)
1. [Wymagania](#wymagania)
1. [Instalacja](#instalacja)
1. [Konfiguracja](#konfiguracja)
    * [Parametry](#parametry)
1. [Informacje o cechach](#informacje-o-cechach)
    * [Kolejność metod płatności](#kolejność-metod-płatności)
    * [Ponowienie płatności](#ponowienie-płatności)
    * [Zapisywanie kart](#zapisywanie-kart)

### Cechy
Moduł płatności PayU dodaje do Magento 2 opcję płatności PayU. Moduł współpracuje z Magento 2 w wersji 2.4

Możliwe są następujące operacje:
  * Utworzenie płatności w sytemie PayU
  * Automatyczne odbieranie powiadomień i zmianę statusów zamówienia
  * Odebranie lub odrzucenie płatności (w przypadku wyłączonego autoodbioru)
  * Wyświetlenie metod płatności i wybranie metody na stronie podsumowania zamówienia
  * Płatność kartą bezpośrednio na stronie podsumowania zamówienia
  * Zapisanie karty i płatność zapisaną kartą
  * Ponowienie płatności
  * Utworzenie zwrotu online (pełnego lub częściowego)
  * Promowanie płatności kredytowych wykorzystując [widget kredytowy](#widget-kredytowy) w różnych podstronach sklepu (np. na stronie produktu, w koszyku)

Moduł dodaje następujące metody płatności:
  * **Płatność PayU** - wybór metody płatności i przekierowanie do banku lub formatkę kartową
  * **Płatność kartą** - wpisanie numeru karty bezpośrednio na stronie sklepu i płatność kartą
  * **PayU Raty** - płatności ratalne z przekierowaniem do formatki ratalnej PayU
  * **PayU Klarna** - odroczone płatności Klarna z przekierowaniem do formatki Klarna w PayU
  * **PayU PayPo** - odroczone płatności PayPo z przekierowaniem do formatki PayPo w PayU
  * **PayU PragmaPay** - odroczone płatności PragmaPay z przekierowaniem do formatki PragmaPay w PayU
  * **PayU Twisto** - odroczone płatności Twisto z przekierowaniem do formatki Twisto w PayU
  * **PayU Twisto podziel na 3** - odroczone płatności Twisto podziel na 3 z przekierowaniem do formatki Twisto podziel na 3 w PayU

![methods][img0]

### Wymagania

**Ważne:** Moduł ta działa tylko z punktem płatności typu `REST API` (Checkout), jeżeli nie posiadasz jeszcze konta w systemie PayU [**zarejestruj się w systemie produkcyjnym**][ext1] lub [**zarejestruj się w systemie sandbox**][ext5]

* Wersja PHP zgodna z wymaganiami zainstalowanej wersji Magento 2
* Rozszerzenia PHP: [cURL][ext2] i [hash][ext3].

### Instalacja

##### Przy użyciu Composer
`composer require payu/magento24-payment-gateway`

##### Kopiując pliki na serwer
1. Pobierz najnowszą wersję moduł z [repozytorium GitHub][ext4]
1. Rozpakuj pobrany plik
1. Połącz się z serwerem ftp i skopiuj rozpakowaną zawartość do katalogu `app/code/PayU/PaymentGateway` swojego sklepu Magento 2. Jeżeli nie ma takiego katalogu utwórz go.

Po instalacji przy użyciu Composer lub kopiując pliki z poziomu konsoli uruchom:
   * php bin/magento module:enable PayU_PaymentGateway
   * php bin/magento setup:upgrade
   * php bin/magento setup:di:compile
   * php bin/magento setup:static-content:deploy

### Konfiguracja

1. Przejdź do strony administracyjnej swojego sklepu Magento 2 [http://adres-sklepu/admin_xxx].
1. Przejdź do  **Stores** > **Configuration**.
1. Na stronie **Configuration** w menu po lewej stronie w sekcji **Sales** wybierz **Payment Methods**.
1. Na liście dostępnych metod płatności należy wybrać właściwą sekcję z listy metod **PayU** w celu konfiguracji parametrów wtyczki.
1. Po zmanie paramettrów naciśnij przycisk `Save config`.

#### Parametry API

| Parameter              | Opis                                                                                                                                    |
|------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| Tryb testowy (Sandbox) | `Tak` - transakcje będą procesowane przez system Sandbox PayU. <br/> `Nie` - transakcje będą procesowane przez system produkcyjny PayU. |

##### Parametry punktu płatności (POS)

| Parameter | Opis |
|---------|-----------|
| Id punktu płatności| Identyfikator POS-a z systemu PayU |
| Drugi klucz MD5 | Drugi klucz MD5 z systemu PayU |
| OAuth - client_id | client_id dla protokołu OAuth z systemu PayU |
| OAuth - client_secret | client_secret for OAuth z systemu PayU |

##### Parametry punktu płatności (POS) - Tryb testowy (Sandbox)
Dostępne gdy parametr `Tryb testowy (Sandbox)` jest ustawiony na `Tak`.

| Parameter | Opis |
|---------|-----------|
| Id punktu płatności| Identyfikator POS-a z systemu PayU |
| Drugi klucz MD5 | Drugi klucz MD5 z systemu PayU |
| OAuth - client_id | client_id dla protokołu OAuth z systemu PayU |
| OAuth - client_secret | client_secret for OAuth z systemu PayU |

#### Parametry wtyczki "PayU - widget kredytowy"

_(README truncated for .md surface. Full README on https://packagento.com/payu/magento24-payment-gateway.)_

## Changelog

* Fixed #49 - filtered payment methods (thanks @Tomasz-Silpion)

### 2.0.6
* add support for credit payment methods:
    * [PayU | Installments](https://developers.payu.com/europe/docs/payment-solutions/credit/installments/)
    * [PayU Pay Later](https://developers.payu.com/europe/docs/payment-solutions/credit/paylater/)
* add support for the [credit widget](https://developers.payu.com/europe/docs/payment-solutions/credit/widget/)
* IMPORTANT: the sandbox flag was changed to support all payment methods with one configuration - please review sandbox flag configuration after update

### 2.0.5
* Fixed #38 - `di:compile` returned error in PHP 8.4

### 2.0.4
* Fixed #33 - translate

### 2.0.3
* Fixed #30 - RepayOrderCreateResponseHandler without PayU method
* Fixed #24 and #29 - empty response for payByLinks
* Fixed for php version 7.4

### 2.0.2
* Updated php required version to 7.4
* Fixed typo for php version 7.4

### 2.0.1
* Fixed #27 - build product data

### 2.0.0
#### BREAKING CHANGES
* **Common configuration for API parameter regardless of method and changed `config_path` - required to re-enter all configurations**
##### OTHER CHANGES
* Use of order currency (not base currency) for create order in PayU
* Updated logotypes and colors
* Removed MCP
* Refactored, cleanup and removal deprecations

### 1.0.12
* Sends more data for better detected frauds

### 1.0.11
* Licence updated

### 1.0.10
* Fix #21
* Better handling errors in notifications

### 1.0.9
* Fix #16 - Customer IP

### 1.0.8
* Update PayU SDK
* Get customer IP from request

### 1.0.7
* Get customer data from billing address
* Fix #15 - Shorter order description

### 1.0.6
* Fix #14 - Link to repayment in email was incorrect

### 1.0.5
* Fix #10 - Restore Coupon Code after Order Cancellation
* Fix #12 - Hide "My Stored Cards" when Payu Cards is not active

### 1.0.4
 * Fix #5 - Impossible create order when repay is enabled
 * Fix #8 - wrong amount in refund
 * Update PayU SDK

### 1.0.3
 * Fix doubles PENDING status
 * Set correct state

### 1.0.2
 * Remove Apple Pay when not available

### 1.0.1
 * Fix create refund and invoice from admin

### 1.0.0
 * First release for Magento 2.4

## Recent Versions

| Version | Released |
|---|---|
| 2.0.7 | 2026-04-22 |
| 2.0.6 | 2026-02-26 |
| 2.0.5 | 2025-05-30 |
| 2.0.4 | 2024-10-08 |
| 2.0.3 | 2024-07-05 |
| 2.0.2 | 2024-05-02 |
| 2.0.1 | 2024-01-30 |
| 2.0.0 | 2024-01-17 |
| 1.0.12 | 2023-07-25 |
| 1.0.11 | 2022-11-24 |

Showing 10 of 21 versions. Full release history on https://packagento.com/payu/magento24-payment-gateway.

## Dependencies

### Require

| Package | Constraint |
|---|---|
| ext-json | * |
| magento/module-sales | 103.0.* |
| php | >=7.4 |

## Quality

Latest release (2.0.7) fails the Packagento QA pipeline. Verdicts below are per-cell (Magento line × PHP version) for the matrixed tools, and run-once for the static / security tiers.


### Compatibility

Each Magento line is installed on its supported PHP versions, then the module is built (DI compile + static-content deploy). Cells show passed / failed / untested; staircase gaps render as `–`.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | Pass | Pass | – | – |
| 2.4.8 | – | Pass | Pass | – |
| 2.4.9 | – | – | Pass | Pass |


### Code Quality

Advisory checks against the module's source. Never affect the Compatibility verdict — a phpcs finding can't make a module incompatible.

#### Static Analysis

Coding standards (phpcs), mess detection (phpmd), copy-pasted code (cpd), PHP cross-version compatibility, composer.json validity. Each runs once for the whole module.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| PHPCS | Fail | 675 | 68 errors, 607 warnings (ruleset: Magento2) — 230 auto-fixable with phpcbf |
| PHPMD | Warning | 95 | 95 rule violations (MissingImport:83, ErrorControlOperator:3, CyclomaticComplexity:2, NPathComplexity:2, IfStatementAssignment:2) |
| Cpd | Warning | 3 | 3 duplicated chunks spanning 89 total lines (min-lines=5, min-tokens=70) |
| Composer validate | Info | 1 | valid; 1 advisory note (composer validate --strict) |

#### PHPStan

Type-checks the module against a real Magento install. Re-runs per Magento + PHP version because resolvable symbols differ between releases.

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | 113 | 113 | – | – |
| 2.4.8 | – | 114 | 114 | – |
| 2.4.9 | – | – | 114 | 114 |


### Tests

Unit and integration suites run per Magento + PHP cell. Test failures speak to the module's behaviour, not its compatibility with a line, so they're reported here separately.

#### Unit Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |

#### Integration Tests

| Magento | PHP 8.2 | PHP 8.3 | PHP 8.4 | PHP 8.5 |
|---|---|---|---|---|
| 2.4.7 | N/A | N/A | – | – |
| 2.4.8 | – | N/A | N/A | – |
| 2.4.9 | – | – | N/A | N/A |


### Security

Dependency-advisory audit (composer audit) plus a source malware scan. A malware detection fails the version outright.

| Tool | Status | Findings | Summary |
|---|---|---|---|
| Composer audit | Pass | 0 |  |
| Malware scan | Pass | 0 |  |

## Licence and pricing

Free. A licence is still minted on checkout and bound to your project for Composer access — no payment step.

Refundable within 14 days of first purchase via https://packagento.com/account/refunds/.

## Install via Claude Code or any MCP client

The Packagento MCP server can run the licence + project + Composer steps above in one tool call:

```
purchase_and_install_packages(
  composer_names=["payu/magento24-payment-gateway"],
  project_id="proj_xxx"
)
```

This handles cart, checkout, licence minting, project activation, and writes auth.json credentials. Connect a client with `claude mcp add packagento https://mcp.packagento.com`. Full setup at https://packagento.com/docs/mcp-setup.

## Vendor

payu is a Magento 2 vendor on Packagento. See https://packagento.com/payu.md for their full catalogue.

