payu / magento24-payment-gateway

payu/magento24-payment-gateway

Official PayU integration plugin for Magento 2.4

magento2-module Compatibility: Not compatible Code Quality: Fail Tests: N/A Security: Pass apache-2.0

Are you the maintainer of payu?

Packagento pulls payu's Composer packages from the public registry so buyers can find them here.

Claim the namespace to take ownership, publish new releases directly, and start charging for premium versions.

Claim this namespace →

Wersja polska

PayU module for Magento 2 version 2.4

BREAKING CHANGES

Due to changes described in CHANGELOG after updating plugin from version 1.X to 2.X, you must reconfigure plugin.

If you have any questions or if you want to report an error, please contact our support at the address: [email protected].

Table of contents

  1. Properties
  2. Requirements
  3. Installation
  4. Configuration
  5. Information about properties

Properties

PayU payment module adds a PayU payment option to Magento 2. The module works together with Magento 2 version 2.4

The following operations are possible:

  • Creation of payment in the PayU system
  • Automatic receipt of notifications and change of order status
  • Receipt or rejection of payment (in case of switched off automatic receipt)
  • Display of payment method and selection of the method on the order summary page
  • Payment by card directly on the order summary page
  • Remembering of cards and payment with the remembered card
  • Repeat payment
  • Creation of online refund (full or partial)
  • Promoting credit payments using credit widget on different subpages of the store (e.g. on the product page, in the cart)

The module adds these payment methods:

  • PayU payment - selection of payment method and redirection a bank or card form
  • Card payment - entry of the card number directly on the store's website and payment by card
  • PayU - Google Pay - Google Pay payment directly on checkout (without redirecting the customer outside the store)
  • PayU Installments - installment payments with a redirect to the PayU installment form.
  • PayU Klarna - deferred Klarna payments with a redirect to the Klarna form in PayU.
  • PayU PayPo - deferred PayPo payments with a redirect to the PayPo form in PayU.
  • PayU PragmaPay - deferred PragmaPay payments with a redirect to the PragmaPay form in PayU.
  • PayU Twisto - deferred Twisto payments with a redirect to the Twisto form in PayU.
  • PayU Twisto Pay in 3 - deferred Twisto Pay in 3 payments with a redirect to the Twisto Pay in 3 form in PayU

[image: methods]

Requirements

Important: The module works only with the REST API (Checkout) POS, if you don't have an account in the PayU system yet, register yourself in the production system or in the sandbox system

  • PHP compliant with the requirements of the installed version of Magento 2
  • PHP extension: cURL and hash.

Installation

Using Composer

composer require payu/magento24-payment-gateway

After installation from the console's level, run:

  • 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

Configuration

  1. Go to the administration page of your Magento 2 store [http://adres-sklepu/admin_xxx].
  2. Go to Stores > Configuration.
  3. On the Configuration page in the menu on the left-hand side, in the section Sales choose Payment Methods.
  4. On the list of available payment methods choose one of the PayU methods to configure the plugin's parameters.
  5. After changing the parameters click Save config.

API Parameters

Parameter Description
Test mode (Sandbox) Yes - transactions are processed by the PayU Sandbox system.
No - transactions are processed by the PayU production system.

Point of sale (POS) parameters

Parameter Descripction
POS IdD POS ID from PayU system
Second MD5 key Second MD5 key from PayU system
OAuth - client_id client_id for OAuth protocol from PayU system
OAuth - client_secret client_secret for OAuth from PayU system

POS parameters - Test mode (Sandbox)

Available when the parameter Test Mode (Sandbox) is set for Yes.

Parameter Description
POS ID POS ID from PayU system
Second MD5 key Second MD5 key from PayU system
OAuth - client_id client_id for OAuth protocol from PayU system
OAuth - client_secret client_secret for OAuth from PayU system

"PayU Credit widget" plugin parameters

Parameter Description
Enable widget for product view Value Yes|No. Displays the widget on product pages.
Enable widget for catalog view Value Yes|No. Displays the widget on pages with product lists (e.g., categories).
Enable widget for catalog widgets eg. hot, new Value Yes|No. Displays the widget on pages with product list widgets (e.g., bestseller, new).
Experimental feature
Enable widget for checkout Value Yes|No. Displays the widget on the cart page.
Enable widget for minicart Value Yes|No. Displays the widget in the cart summary dropdown.
Enable widget for cart summary Value Yes|No. Displays the widget on the cart summary page with the payment method selection.
Excluded payTypes Comma-separated list of payment methods to omit during widget display.
It is recommended to leave this list empty

"PayU Payment" parameters

Parameter Description
Activate the plugin? Determines whether the payment method will be available in the store on the list of payments.
Order of payment methods Determines the order of the payment methods being displayed more information.
Activate repeat payment? more information
Sort Order Position of the payment method in the list of payment methods.

"PayU - Cards" parameters

Parameter Description
Activate the plugin? Determines whether the payment method will be available in the store on the list of payments.
Activate repeat payment? more information
Activate remembering of cards? more information
Sort Order Position of the payment method in the list of payment methods.

"PayU - Google Pay" parameters

Parameter Description
Activate the plugin? Determines whether the payment method will be available in the store on the list of payments.
Activate repeat payment? more information
Sort Order Position of the payment method in the list of payment methods.
Google Pay Merchant ID Merchant identifier in Google. You need to verify your shop in Google, following the instructions.
Google Merchant Name Merchant name displayed in Google Pay (should match your Google Pay profile).

"PayU - Installments", "PayU - Klarna", "PayU - PayPo", "PayU - PragmaPay", "PayU - Twisto", "PayU - Twisto Pay in 3" payment parameters

Parameter Description
Activate the plugin? Determines whether the payment method will be available in the store on the list of payments.
Activate repeat payment? more information
Sort Order Position of the payment method in the list of payment methods.

Information about properties

Order of payment methods

To determine the order of display of payment method icons indicate the payment method symbols, separating them with a comma. List of payment methods.

Repeat payment

To use this option the POS should be properly configured in PayU and automatic receipt of payments should be disabled (auto-receipt is on by default).
To do that log in to the PayU panel, go to the tab "Electronic payments", then click "My stores" and POS in the given store.
The "Automatic payment receipt" option can be found at the bottom under the list of payment methods.

Repeat payment makes it possible to activate multiple payments in PayU to a single order in Magento.
The plugin will automatically take receipt of the first successful payment while the other ones will be cancelled.
Repeat payment from the buyer's point of view is also possible through the list of orders in Magento (a link "Pay again" will appear there).
The buyer will also automatically receive an e-mail with such link.
Thus, the buyer is able to successfully pay for his order even if the first payment was unsuccessful (for instance, no funds on the card, problems logging in to the bank, etc.).

Saving cards

Saving card allows logged in users to remember the card for future payments.
Each such remembered card is "tokenized", however, Magento does not process the card's full details in any way (they are entered using an embedded widget hosted by PayU) and does not save card tokens in its database (before use, current tokens for the given user are always downloaded from PayU).

To ensure proper functioning of the service additional configuration in PayU, consisting in creating and receiving tokens, is required.
Additionally, the principles of authenticating payments with the remembered card can also be determined (by default every payment with a saved card requires providing a CVV code and being authenticated by 3DS but, for instance, an amount limit up to which this will not be necessary can be defined).

The buyer may save the card while making a payment, using the option "Use and save" on PayU widget while entering the card's details.
Each card being remembered is subject to strong authentication during first payment (CVV and 3DS).
A saved card will appear after choosing to pay with a card through PayU for the order and is visible in the user's account (tab "My saved cards"), where an option to delete it is also available.

Credit widget

To inform customers about credit payment options for a specific product, we recommend placing the credit widget next to products in product lists, in the description (details) of the selected product, in the cart, and at checkout (before payment).
The configuration parameters described in the section "PayU Credit widget" plugin parameters allow flexible management of where the credit widget is displayed.

Example presentation of the credit widget

[image: widget]

2.1.0

  • Added Google Pay as a separate payment method
  • Fixed pay by stored card
  • Removed es6 promise polyfill
  • Added PayU SDK as composer depends

2.0.8

  • Fixed Credit Widget
  • Updated PayU SDK
  • Added checking for order access during repayment
  • Added the option to cancel the order on PayU
  • Cleaned code (thanks @hostep)
  • Fixed #43, #44 and guest repayment
  • Added better management of displayed payment methods (fix #23)
  • Fixed #61 - not displayed Klarna for CZK
  • Fixed #62 - Missing checkout agreements in credit methods
  • Change return url for repayment for guest

2.0.7

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

2.0.6

  • add support for credit payment methods:
  • add support for the 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
Versions
Version Stability QA Status Compatibility Released
2.1.0 stable Fail Not compatible Details 2026-07-15 11:34:55
2.0.8 stable Fail Magento 2.4.7-2.4.9 Details 2026-06-23 11:43:19
2.0.7 stable Fail Magento 2.4.7-2.4.9 Details 2026-04-22 09:38:56
2.0.6 stable Not tested Not yet tested Details 2026-02-26 10:02:54
2.0.5 stable Not tested Not yet tested Details 2025-05-30 12:28:20
2.0.4 stable Not tested Not yet tested Details 2024-10-08 11:59:22
2.0.3 stable Not tested Not yet tested Details 2024-07-05 07:55:53
2.0.2 stable Not tested Not yet tested Details 2024-05-02 12:39:04
2.0.1 stable Not tested Not yet tested Details 2024-01-30 09:41:41
2.0.0 stable Not tested Not yet tested Details 2024-01-17 10:43:56
1.0.12 stable Not tested Not yet tested Details 2023-07-25 10:53:21
1.0.11 stable Not tested Not yet tested Details 2022-11-24 09:24:58
1.0.10 stable Not tested Not yet tested Details 2022-09-08 06:53:53
1.0.9 stable Not tested Not yet tested Details 2021-11-15 07:31:12
1.0.8 stable Not tested Not yet tested Details 2021-11-03 10:02:13
1.0.7 stable Not tested Not yet tested Details 2021-10-26 11:31:42
1.0.6 stable Not tested Not yet tested Details 2021-09-13 06:47:41
1.0.5 stable Not tested Not yet tested Details 2021-08-11 06:06:29
1.0.4 stable Not tested Not yet tested Details 2021-07-27 06:26:22
1.0.3 stable Not tested Not yet tested Details 2021-05-17 13:14:41
1.0.2 stable Not tested Not yet tested Details 2020-12-08 12:58:40
1.0.1 stable Not tested Not yet tested Details 2020-09-01 11:54:56
1.0.0 stable Not tested Not yet tested Details 2020-08-20 07:45:59

Requires 7

Package Constraint
ext-curl *
ext-json *
magento/module-checkout 103.0.*
magento/module-payment 103.0.*
magento/module-sales 103.0.*
openpayu/openpayu 2.4.*
php >=7.4

Compatibility

Each Magento release line is installed on its supported PHP versions, then the module is built (DI compilation + static-content deploy) and its unit and integration suites are run. The matrix shows the lines and PHP versions the module is confirmed to install and run on. Code-quality results further down (phpstan, phpcs, …) are reported separately and never affect compatibility.

Compatibility matrix (Magento × PHP)
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 not tested Fail magento version unsupported
2.4.8 Fail magento version unsupported Fail magento version unsupported
2.4.9 not tested Fail magento version unsupported

Code Quality

Advisory checks against the module's source. Static analysis runs once across the whole module; PHPStan re-runs per Magento + PHP version because resolvable symbols differ between releases. These NEVER affect the Compatibility badge. 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.

Static analysis results
Tool Status Findings Summary
PHPCS Fail 415 23 errors, 392 warnings (ruleset: Magento2), 149 auto-fixable with phpcbf
PHPMD Warning 13 13 rule violations (MissingImport:9, CyclomaticComplexity:2, NPathComplexity:2)
Cpd Warning 2 2 duplicated chunks spanning 71 total lines (min-lines=5, min-tokens=70)
Composer validate Info 1 valid; 1 advisory note (composer validate --strict)

PHPStan

Type-checks the module's PHP against a real Magento install at the configured gate level. Re-runs per Magento and PHP version because resolvable symbols differ between releases.

PHPStan results by Magento and PHP version
Magento PHP 8.2 PHP 8.3 PHP 8.4 PHP 8.5
2.4.7 93 93
2.4.8 93 93
2.4.9 93 93

Tests

Unit and integration suites, run for each applicable Magento and PHP version. A test failure speaks to the module's behaviour, not its compatibility with a Magento line, so it is reported here separately and never reddens the compatibility matrix.

Unit tests

Unit tests results by Magento and PHP version
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

Integration tests results by Magento and PHP version
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

Security checks run directly against the module: an audit of its declared dependencies for known vulnerabilities (composer audit) and a scan of its source for malware and web-shell signatures. Each runs once. A malware detection fails the version outright.

Security results
Tool Status Findings Summary
Composer audit N/A 0 no resolvable dependency tree to audit: Your requirements could not be resolved to an installable set of packages. Problem 1
Malware scan Pass 0
License
apache-2.0
Authors
  • PayU S.A.
Make it pay

Turn an existing module into recurring revenue.

If you already maintain a Magento 2 module on GitHub or GitLab, listing it on Packagento takes about five minutes. We mirror your tags, handle distribution signing, and route paid licenses through Stripe Connect, so you can keep shipping the way you already do.