LokiCheckout_PayUIndia
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:
Step\FinalStep\Task\PrepareOrderTaskassigns the PayU transaction id to the order and moves it topending_payment.Payment\Redirect\RedirectResolversends the shopper tolokicheckout_payuindia/payment/redirect.- That page posts the order to PayU, or launches the Bolt SDK.
- The upstream
payu/standard/responseandpayu/standard/cancelcontrollers 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
@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
LokiCheckout_PayUIndialoki-checkout/magento2-pay-u-india
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
payupayment method ofPayUIndia_Payuwithin 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.inand an inline-script policy scoped to the hand-off page. enforce_paymethodis read from the order payment, so a payment-method component can preselect a PayU option later without changes here.