Medusa plugins
R

Razorpay payment

A starter for Medusa plugins.

Need customizations for this plugin?

Get in touch
npm install @tsc_tech/medusa-plugin-razorpay-payment
Category
other
Built by
tsc_tech
Type
unknown
Last updated
4 months ago
Monthly downloads
154
Github stars
6

Compatibility

This starter is compatible with versions >= 2.4.0 of .

Payment-Razorpay

Support the Payment-Razorpay Provider - Elevate Our Medusa Community!

Dear Developers and E-commerce Enthusiasts,

Are you ready to revolutionize the world of online stores with MedusaJS? We have an exciting opportunity that will make payment processing a breeze for our beloved Medusa platform! Introducing the Payment-Razorpay provider, a community-driven project that brings the immensely popular RAZORPAY payment gateway to our MedusaJS commerce stack.

What's in it for You:

🚀 Streamline Payment Processing: With Payment-Razorpay, you can unleash the full potential of Razorpay's features, ensuring seamless and secure payments for your customers.

🌐 Global Reach: Engage with customers worldwide, as Razorpay supports various currencies and payment methods, catering to a diverse audience.

🎉 Elevate Your Medusa Store: By sponsoring this provider, you empower the entire Medusa community, driving innovation and success across the platform.

Installation Made Simple

No hassle, no fuss! Install Payment-Razorpay effortlessly with npm:

RAZORPAY an immensely popular payment gateway with a host of features. This provider enables the razorpay payment interface on medusa commerce stack

Installation

Use the package manager npm to install Payment-Razorpay.

npm install @tsc_tech/medusa-plugin-razorpay-payment
yarn add @tsc_tech/medusa-plugin-razorpay-payment

Additionally, install the Razorpay package:

npm install razorpay
yarn add razorpay

Configuration

Step 1: Register on Razorpay Create an account on Razorpay and generate API keys from the Razorpay dashboard.

Step 2: Set Up Environment Variables In your .env file, define the following variables:

Step 3: Update Medusa Configuration Modify your medusa-config.ts to include the Razorpay provider:

Client-Side Configuration (Next.js)

For Next.js projects, install the Razorpay package:

  1. Install package to your next starter. This just makes it easier, importing all the scripts implicitly
  1. Create a button for Razorpay /src/modules/checkout/components/payment-button/razorpay-payment-button.tsx

like below

Step 3.

nextjs-starter-medusa/src/lib/constants.tsx add

step 4.add into the payment element /src/modules/checkout/components/payment-button/index.tsx

first

then

Step 4. modify initiatePaymentSession in the client storefront/src/modules/checkout/components/payment/index.tsx

Step 5. Add environment variables in the client

NEXT_PUBLIC_RAZORPAY_KEY: NEXT_PUBLIC_SHOP_NAME: NEXT_PUBLIC_SHOP_DESCRIPTION:

watch out

Step 6. Caveat the default starter template has an option which says use the same shipping and billing address please ensure you deselect this and enter the phone number manually in the billing section.

Step 7.

In razorpay create a webhook with the following url

/hooks/payment/razorpay_razorpay

Contributing

Contributions are welcome! For significant changes, please open an issue first to discuss your proposed modifications.

Kindly ensure that tests are updated as needed.

License

MIT

Untested features

These features exists, but without implementing the client it isn't possible to tests these outright

  1. Capture Payment
  2. Refund

Disclaimer

The code has been tested in a limited number of scenarios, so unforeseen bugs may arise. Please report any issues you encounter or submit a pull request if you'd like to contribute fixes.

Support the Razorpay-Payment Provider - Strengthen Our Medusa Community!