LokiCheckout_PayUIndia

This module is available free of charge as part of Loki Checkout. Please note that support for this module is not included and is available on an hourly basis.
Payment
PHP 8.1 - 8.4
Magento 2.4.7 | 2.4.8
CSP Yes
PHPStan 5
Magento PHPCS 10

Magento version PHP version License Latest Version

This Magento 2 module is an add-on package to the LokiCheckout.

It makes the payu payment method of the PayU India module (PayUIndia_Payu) work inside the Loki Checkout.

Requirements

PayUIndia_Payu must be installed and enabled. It is not distributed via Packagist, so this package cannot declare it as a composer dependency - install it yourself. Without it, this module stays completely inert: no icon, no hand-off, no changes to the order.

Installation

Install this package via composer:

composer require loki-checkout/magento2-pay-u-india

Next, enable this module:

bin/magento module:enable LokiCheckout_PayUIndia

Configuration

All settings are the ones of the PayU module itself, under Stores > Configuration > Sales > Payment Methods > PayU. The ones that change how this module behaves:

| Setting | Effect | |---|---| | Payment Type (payment/payu/paymentaction) | Redirect posts the order to the PayU endpoint; BOLT launches the PayU Bolt SDK on the hand-off page. Anything else falls back to Redirect. | | Environment (payment/payu/environment) | Selects the sandbox or production endpoint, and the matching Bolt SDK. | | Merchant Key / Salt Key | Required. The hand-off fails with an error when either is empty. | | Custom Transaction ID (payment/payu/uniquetxnid) | Ignored. This module always appends a random suffix to the transaction id - see below. |

How it works

Loki Checkout places the order itself, so the upstream flow (where PayU places the order from its own controller) is not used. Instead:

  1. Step\FinalStep\Task\PrepareOrderTask assigns the PayU transaction id to the order and moves it to pending_payment.
  2. Payment\Redirect\RedirectResolver sends the shopper to lokicheckout_payuindia/payment/redirect.
  3. That page posts the order to PayU, or launches the Bolt SDK.
  4. The upstream payu/standard/response and payu/standard/cancel controllers handle the return leg unchanged.

The order confirmation email is suppressed until PayU confirms the payment (Plugin\Quote\OrderPlaceRedirectUrlPlugin); upstream sends it from its return leg, gated on payment/payu/orderemail.

Why the transaction id always gets a random suffix

Upstream makes this optional, but with it disabled the transaction id equals the quote id. Because the upstream cancel controller reactivates the quote after a failed payment, a retry would produce a second order carrying the same transaction id, and upstream resolves the return leg with an unsorted single-row lookup on that value - updating whichever order the database happens to return first.

Current status

Static Tests Unit Tests Integration Tests Playwright DI Compilation

WARNING: This module has no releases yet. If you want to use it, make sure to add the version @dev to the composer command.

Support

For getting support, create an Issue under the following project URL:

https://gitlab.yireo.com/loki-checkout/LokiCheckout_PayUIndia.git

Module Dependencies

The following dependencies are declared in the module its `etc/module.xml` file:

LokiCheckout_Core Loki_Base Loki_Components Loki_CssUtils Loki_FieldComponents Loki_MapComponents Magento_Backend Magento_Catalog Magento_Checkout Magento_CheckoutAgreements Magento_Config Magento_Customer Magento_Directory Magento_Eav Magento_Newsletter Magento_Payment Magento_Quote Magento_Sales Magento_Shipping Magento_Store Magento_Tax Magento_Vault Yireo_CspUtilities
Composer details
Magento module name
LokiCheckout_PayUIndia
Composer name
loki-checkout/magento2-pay-u-india
Composer version
No release yet
Default branch
main
Requirements
ext-json: *
loki-checkout/magento2-core: ^2.0
magento/framework: ^103.0
magento/module-checkout: ^100.4
magento/module-payment: ^100.4
magento/module-quote: ^101.0
magento/module-sales: ^103.0
magento/module-store: ^101.0
php: >=8.2 <8.6
Releases
Changelog

Added

  • Support for the payu payment method of PayUIndia_Payu within the Loki Checkout: payment method icon, transaction id assignment after the order is placed, and a hand-off page that either posts the order to the PayU CGI endpoint (paymentaction=redirect) or launches the Bolt SDK (paymentaction=bolt).
  • Orders awaiting a PayU payment are left at pending_payment, which is also what the upstream reconciliation cron looks for.
  • The order confirmation email is held back until PayU confirms the payment.
  • CSP whitelisting for *.payu.in and an inline-script policy scoped to the hand-off page.
  • enforce_paymethod is read from the order payment, so a payment-method component can preselect a PayU option later without changes here.

Last modified: September 11, 2026