Medusa PayU Payment Provider
This plugin is compatible with Medusa v2.4.0+.
This plugin provides PayU payment integration for Medusa commerce platform.
Add the payment provider configuration to your :
Once configured, PayU will be available as a payment provider in your Medusa store. The plugin integrates seamlessly with Medusa's payment workflow to handle the complete payment lifecycle.
The following data is required from your checkout flow and needs to be provided in the call in order to create a PayU transaction:
When a customer selects PayU as their payment method during checkout, the plugin creates a new transaction with PayU and returns a payment URL.
Redirect: Redirect the customer to the provided PayU payment URL to let them complete the payment on PayU's payment page.
Payment Processing: After completing or canceling the payment, the customer is redirected back to your store via the configured values.
Webhook Notification: PayU sends a webhook notification to your configured endpoint to confirm the payment status. The plugin automatically validates and processes these webhooks.
Order Completion: Based on the webhook data, Medusa updates the payment and order status accordingly.
The webhook endpoint is automatically registered at . Ensure that:
Refunds can be processed through Medusa's admin panel or API. The plugin will:
You can customize the refund description using the option in the plugin configuration.
1npm install @tax1driver/medusa-payu2# or3yarn add @tax1driver/medusa-payu1modules: [2 // ... other modules ...3 {4 resolve: "@medusajs/medusa/payment",5 options: {6 providers: [7 {8 resolve: '@tax1driver/medusa-payu/providers/payu',9 options: {10 clientId: process.env.PAYU_CLIENT_ID,11 clientSecret: process.env.PAYU_CLIENT_SECRET,12 merchantPosId: process.env.PAYU_MERCHANT_POS_ID,13 secondKey: process.env.PAYU_SECOND_KEY,14 sandbox: process.env.PAYU_SANDBOX === "true",15 returnUrl: process.env.PAYU_RETURN_URL,16 17 // By default, this should be your backend's base URL + /hooks/payment/payu (e.g. https://example.com/hooks/payment/payu)18 callbackUrl: process.env.PAYU_CALLBACK_URL || `${process.env.APP_BASE_URL}/hooks/payment/payu`,19 20 title: "Payment for order", // Optional21 refundDescription: "Refund", // Optional22 },23 },24 ],25 }26 }27]1const payuData = {2 customer_ip: string;3 email: string;4}