What is Razorpay for Magento?
Razorpay for Magento is the official razorpay/magento payment module that plugs India’s largest payment gateway into Magento 2, UPI (Google Pay / PhonePe / Paytm UPI / BHIM), Indian cards (Visa / Mastercard / RuPay), wallets, netbanking (50+ banks), EMI (cards + cardless), and Magic Checkout (single-tap COD-to-prepaid). Razorpay is an RBI-licensed Payment Service Provider, the mandatory layer for any D2C / B2C store selling to Indian customers. Standard MDR ~2% (UPI 0% until regulated), with RBI-mandated tokenisation built in.
- Official module razorpay/magento (MIT, free)
- Regulation RBI-licensed Payment Service Provider
- Pricing ~2% MDR (UPI 0%) + RBI tokenisation
Five steps from composer install to live UPI checkout
The official razorpay/magento module ships every Indian payment rail out of the box. Here is the wiring, end to end.
01Composer-install the official Razorpay module
Run composer require razorpay/magento from the Magento project root. The package is published under the MIT licence on Packagist by Razorpay Software Pvt Ltd and is the only payment module officially endorsed by Razorpay for Magento 2.x. Avoid the third-party clones on GitHub: they lag the official module by 6-12 months on RBI compliance patches and routinely break on Magento minor upgrades.
02Register and clear caches
Run bin/magento setup:upgrade --keep-generated to register the module, then bin/magento cache:flush to drop the config / layout / block_html caches. On a production deploy add setup:di:compile and setup:static-content:deploy as part of the normal deployer flow: Razorpay’s admin UI components are compiled assets and need fresh static content to render.
03Paste API keys from the Razorpay dashboard
Sign in at dashboard.razorpay.com → Settings → API Keys, generate a Key ID + Key Secret pair (test mode first, switch to live once KYC is approved). In Magento admin go to Stores → Configuration → Sales → Payment Methods → Razorpay, paste both keys, set Payment Action to Authorize and Capture, and enable the method. Use config-scope-specific keys if you run multiple Indian websites: Razorpay supports one merchant per website.
04Customer pays via UPI, card, EMI, wallet, or netbanking
At the Magento checkout the Razorpay popup widget loads (or embedded inline for Hyvä themes via the 5.x module). The customer picks a method: UPI (Google Pay / PhonePe / Paytm UPI / BHIM intent), Indian cards (Visa / Mastercard / RuPay / Amex), EMI (cards + cardless from Bajaj / ZestMoney / EarlySalary), wallets (Paytm / Mobikwik / Freecharge / Amazon Pay), or netbanking (50+ Indian banks). Razorpay tokenises the card per RBI rules and authorises the payment in < 3 seconds.
05Webhooks fire on capture, failure, and refund
Razorpay POSTs server-to-server webhooks to https://your-store.com/razorpay/webhook on payment.captured, payment.failed, order.paid, and refund.processed. The Magento module verifies the HMAC-SHA256 signature against the webhook secret you set in the Razorpay dashboard, then writes the order state transition (pending → processing → complete). Always enable webhook signing: without it any actor can replay a payment.captured event and mark unpaid orders as paid.
Four scenarios where Razorpay is the obvious answer
If your Magento store touches Indian payment flows, Razorpay is rarely optional. These four scenarios are unambiguous wins.
D2C / B2C stores selling to Indian customers
If your storefront accepts INR and ships to India, Razorpay is effectively mandatory. UPI alone now drives more than 50% of D2C checkout volume in India. A store without UPI loses roughly half its conversions before the customer even reaches the payment screen. Stripe, PayPal, and Adyen don’t process UPI natively. Razorpay does, with sub-3-second authorisation and a fee structure (0% MDR on UPI till the RBI changes the rule) that no foreign PSP matches.
Cross-border stores accepting INR
A US or EU storefront billing Indian customers in INR needs a domestic payment rail to bypass the 3-5% foreign-card surcharge most Indian banks add on cross-border MasterCard / Visa transactions. Razorpay accepts INR locally (no FX markup at checkout), handles AEPS / forex / IRCTC integrations for Indian buyers, and settles to your INR Razorpay current account, from which Razorpay X can wire to your USD / EUR account at near-mid-market rates.
B2B Magento with Indian Net-30 invoicing
B2B Magento stores doing Net-30 / Net-60 invoicing to Indian distributors need RazorpayX for B2B payouts (vendor disbursements, salary, refunds) and optionally Razorpay Capital for invoice financing, lend against unpaid invoices at 11-16% APR. Combined with the Magento module, this gives you collection (cards + UPI + netbanking), payout (RazorpayX), and working-capital (Razorpay Capital) on a single dashboard.
Subscriptions and recurring auto-debit in India
The RBI 2021 recurring-mandate rules killed simple card-on-file recurring debits in India. Razorpay Subscriptions ships an eMandate workflow (UPI AutoPay + card-based recurring under the new RBI framework) that Magento subscription modules (Aheadworks, Mageworx, Amasty) can wire into. If you sell SaaS, dairy / grocery boxes, gym memberships, or any auto-renew product to Indian customers, Razorpay Subscriptions is the only PSP-side integration that survives RBI scrutiny.
Three Razorpay misconfigs that wreck a Magento store
Every Razorpay-related Magento outage I've been called in to debug came from one of these three mistakes. Audit your config and dashboard for them today.
Storing raw card data in Magento
Under the RBI 2022 tokenisation mandate it is illegal for any Indian merchant or PSP to store raw card numbers, expiry dates, or CVVs, only the card-issuer and the card-network may. Every recurring / saved-card flow must use a Razorpay vault token (a network-scope token returned by Razorpay’s tokenise API). Never persist card.number, card.cvv, or card.expiry into the Magento DB, log files, or third-party tools, the RBI fines for non-compliance start at INR 1 crore per breach.
Skipping the Magic Checkout upgrade
India’s Cash-on-Delivery (COD) order rate sits at 60-70% by default, and COD orders have a Return-to-Origin (RTO) rate of 25-35%, which destroys margins after reverse logistics. Razorpay Magic Checkout is a single-tap UPI / card prompt that converts roughly 30% of would-be COD orders into prepaid orders at checkout. Skipping the Magic Checkout integration costs typical D2C stores ~12% revenue from RTO losses alone. The Magento module supports Magic Checkout out of the box, just enable it in admin config.
Leaving webhook signing disabled
By default Razorpay webhooks are unsigned, any client that can POST to your /razorpay/webhook endpoint can fake a payment.captured event and mark unpaid orders as paid. In the Razorpay dashboard → Settings → Webhooks, set a strong webhook secret, then in Magento admin paste the same secret into the Razorpay payment-method config. The module verifies the HMAC-SHA256 signature on every incoming webhook and rejects unsigned or mismatched calls.
Where Razorpay sits in the wider Magento payment stack
Five neighbour concepts most readers want to look at next. Click through for the full deep-dive.
- What is Stripe for MagentoStripe is the global counterpart, cards / Apple Pay / Google Pay / SEPA / ACH for non-Indian markets. Many stores run Razorpay (India) + Stripe (rest of world) side by side.
- What is Klarna for MagentoKlarna is the canonical BNPL (Buy Now Pay Later) provider for EU / US / UK. India equivalent of Razorpay’s cardless EMI / Pay-Later options.
- Magento developer in IndiaIndia-specific Magento implementation services, Razorpay / PayU / CCAvenue integrations, GST tax engine, Shiprocket / Delhivery, INR multi-store.
- Magento extension developmentCustom payment-method modules, wrap a PSP API, add tokenisation, build admin config, handle webhooks. Fixed-price builds for unusual rails (Indian B2B EFT, regional wallets).
- Hire a Magento developerAdobe Certified Magento & Hyvä developer, ten years on platform. Razorpay setup, Magic Checkout, RBI-compliant tokenisation, RazorpayX payouts, fixed-price or hourly.
Razorpay for Magento: frequently asked questions
Razorpay vs Stripe for India: which one wins?
What is UPI and why does my store need it?
How does RBI tokenisation work?
Razorpay Magic Checkout: is it worth the integration cost?
Does Razorpay work with Hyvä themes?
What is Razorpay Affordability / EMI / Pay-Later?
Want a Razorpay audit on your Magento store?
Send your storefront URL: I will run a Razorpay integration audit (module version, webhook signing, tokenisation, Magic Checkout, Hyvä compatibility) and reply with a written tuning plan, fixed-price quote, and earliest start date. 24-business-hour turnaround.