PayU India payment gateway integration for Medusa v2 with redirect flow.
A production-focused PayU India payment provider plugin for Medusa v2 featuring redirect checkout flow, callback handling, and fraud-aware verification.
Medusa Website | Medusa Repository
Run the following command to install the plugin in your Medusa project:
yarn add @sam-ael/medusa-plugin-payuAdd the PayU provider under the payment module options in :
1const modules = [2 // ... other modules3 {4 resolve: "@medusajs/medusa/payment",5 options: {6 providers: [7 {8 resolve: "@sam-ael/medusa-plugin-payu/providers/payu",9 id: "payu",10 options: {11 merchantKey: process.env.PAYU_MERCHANT_KEY,12 merchantSalt: process.env.PAYU_MERCHANT_SALT,13 environment: process.env.PAYU_ENVIRONMENT || "test", // "test" or "production"14 },15 },16 ],17 },18 },19]Define the required credentials and options in your file:
1PAYU_MERCHANT_KEY=your_merchant_key2PAYU_MERCHANT_SALT=your_merchant_salt3PAYU_ENVIRONMENT=test4
5STOREFRONT_URL=http://localhost:80006PAYU_REDIRECT_URL=/order/confirmed7PAYU_REDIRECT_FAILURE_URL=/checkout8PAYU_API_TIMEOUT_MS=30000This plugin exposes an inbound webhook endpoint to handle asynchronous payment updates sent by PayU.
| Method | Endpoint | Description |
|---|---|---|
| Processes incoming transaction updates, verifying authenticity using PayU response hashes. |