Shahid Malla

WHMCS Razorpay Integration: Indian Payment Gateway Setup

Selling hosting to India? Razorpay covers UPI, NetBanking, wallets, cards — all in INR with eMandate for recurring. The complete setup including GST and subscription patterns.

S Shahid Malla
· Jan 30, 2026 · 5 min read · 64 views
shahidmalla.com/blog/whmcs-razorpay-integration-indian-payment-gateway-setup
WHMCS Razorpay Integration: Indian Payment Gateway Setup
On this page (13 sections)

If you sell hosting to Indian customers, Razorpay is non-negotiable. Cards alone won't cut it — UPI, NetBanking, and wallets together are how Indians actually pay online. Stripe India exists but has friction; Razorpay is the local-friendly choice for WHMCS.

This is the setup that works for hosting brands targeting India.

Why Razorpay specifically for India

  • UPI — the dominant Indian payment method. Free for low transaction values. Razorpay supports it natively.
  • NetBanking — Indian customers without cards pay this way.
  • Wallets — Paytm, PhonePe, etc.
  • Cards (Indian + International) — yes.
  • Settlements in INR to your Indian bank account.
  • Compliant with RBI rules for recurring payments (eMandate / e-NACH).

Step 1 — Set up the Razorpay account

  1. Sign up at razorpay.com. You need a registered Indian business (Sole Proprietorship is fine; you'll need GST registration for >₹20L/year).
  2. KYC: PAN, GST, business address, bank account.
  3. Activation typically takes 2-3 business days.
  4. Once activated, you get test mode + live mode.

Step 2 — Get API credentials

Razorpay Dashboard → Settings → API Keys → Generate Test Key (for development) and Live Key (for production).

You get:

  • Key ID — looks like rzp_test_XXXXXXXX or rzp_live_XXXXXXXX.
  • Key Secret — keep this server-side only.

Step 3 — Install the WHMCS Razorpay module

Razorpay provides an official WHMCS module. Download from their GitHub or their docs page. Upload to /modules/gateways/.

If using a third-party module instead, vet it carefully — payment gateway modules touch sensitive data.

Activate: WHMCS Admin → Setup → Payments → Payment Gateways → Razorpay → Activate.

Step 4 — Configure the module

  • Display Name: "Pay with Razorpay (Cards, UPI, NetBanking)".
  • Key ID: your live key ID.
  • Key Secret: your live key secret.
  • Webhook Secret: set in step 5.
  • Convert To For Processing: INR. WHMCS converts the invoice amount to INR for processing.
  • Subscriptions: enable if you need recurring billing.

Step 5 — Set up the webhook

Critical for refunds and disputes syncing back to WHMCS.

  1. Razorpay Dashboard → Settings → Webhooks → Add New Webhook.
  2. URL: https://yourwhmcs.com/modules/gateways/callback/razorpay.php.
  3. Events: payment.authorized, payment.captured, payment.failed, refund.created, refund.processed, subscription.charged, subscription.cancelled.
  4. Set a webhook secret (Razorpay generates one).
  5. Paste the secret into WHMCS Razorpay module config.

Step 6 — Test the integration

Use Razorpay test keys and their test card numbers:

  • Test card: 4111 1111 1111 1111 (any future expiry, any CVV).
  • Test UPI ID: success@razorpay for success; failure@razorpay for failure.
  • Test NetBanking: pick any bank; pop-up shows success/failure buttons.

Run the full cycle:

  1. Place test order in WHMCS.
  2. Pay via card / UPI / NetBanking.
  3. WHMCS marks invoice paid.
  4. Refund from Razorpay dashboard → invoice marks refunded.
  5. Test recurring renewal if applicable.

Recurring billing — the Indian rules

RBI's 2021 rules mean stored cards can't be auto-charged without explicit customer consent. Razorpay handles this via eMandate / e-NACH — the customer authorizes once via a digital mandate; future charges work.

For hosting renewals:

  • First order: customer pays normally via Razorpay.
  • If recurring enabled: Razorpay creates a Subscription object linked to the customer's mandate.
  • WHMCS's renewal cycle triggers the next invoice; Razorpay charges via the mandate; success/failure via webhook.

Without eMandate setup, every renewal requires customer to manually pay. Configure Subscriptions in your Razorpay module + WHMCS automation.

Step 7 — GST configuration

For Indian customers, your invoices need GST breakdown. See my tax/GST guide — separate setup in WHMCS.

How to verify everything works

  • Place an order paying with each method (Card, UPI, NetBanking).
  • Confirm invoice marks paid for each.
  • Razorpay dashboard shows the transactions.
  • Refund one transaction; confirm WHMCS reflects it.
  • Test the eMandate flow for recurring.
  • Verify GST appears correctly on invoices.

Common pitfalls

"Razorpay charge succeeds but WHMCS invoice unpaid." Webhook isn't reaching WHMCS. Check WAF/Cloudflare blocking Razorpay IPs.

"Subscriptions failing on renewal." Mandate not properly set up at first order, or amount exceeds mandate cap. Customer needs to re-authorize.

"International cards declined." Razorpay supports international cards but each transaction needs explicit enabling in dashboard. Settings → International Payments → Enable.

"Customer pays in USD but Razorpay processes in INR with weird conversion." Your WHMCS is set to USD, "Convert To For Processing" sends INR. Razorpay sees INR amount. The conversion rate WHMCS uses may differ from market. Either bill in INR directly or accept the spread.

My take — gateway combination for India

For hosting brands selling to India:

  1. Razorpay as primary (covers UPI / NetBanking / cards / wallets).
  2. PayPal as backup (some Indian customers prefer PayPal for international purchases).
  3. Don't bother with Stripe India unless you have specific reasons.

For mixed audiences (Indian + international): Razorpay for INR, Stripe for USD. WHMCS supports multi-currency with per-currency gateway preferences.

Going further


I set up Razorpay + WHMCS for Indian hosting brands — KYC guidance, gateway config, subscriptions / eMandates, GST integration. Tell me about your hosting business and I'll send a quote in 24 hours.

Share this article

S

Written by

Shahid Malla

WHMCS expert, full-stack developer, technical lead at Fada.cloud. 10+ years building hosting platforms, custom modules, and automation that ships.

Trusted platforms

Prefer to hire through a platform?

Not sure about working directly? Hire me through Fiverr or Upwork instead - same me, same work, with the platform's buyer protection and escrow.

Got a project like this?

Tell me what you need - I'll send a real quote within 24 hours.