Shahid Malla

WHMCS Razorpay Integration: Indian Payment Gateway Setup Guide

Shahid Malla Shahid Malla January 30, 2026 13 min read
WHMCS Razorpay Integration: Indian Payment Gateway Setup Guide

Razorpay is India's leading payment gateway, essential for any hosting business targeting Indian customers. With support for UPI, cards, netbanking, wallets, and EMI options, Razorpay provides the complete payment solution for your WHMCS installation.

Why Razorpay for India?

  • UPI payments - 50%+ of Indian online transactions
  • All Indian debit/credit cards supported
  • 100+ bank netbanking options
  • EMI options for large purchases
  • Competitive 2% transaction fees
  • T+2 settlement to bank account

Prerequisites

Before starting, you need:

  • WHMCS 8.0 or later
  • Razorpay account (sign up at razorpay.com)
  • KYC verification completed
  • Business PAN and GST (for recurring payments)
  • SSL certificate on WHMCS installation

Step 1: Get Razorpay API Keys

  1. Log in to Razorpay Dashboard
  2. Go to Settings → API Keys
  3. Click Generate Key
  4. Copy and save:
    • Key ID: Starts with rzp_test_ or rzp_live_
    • Key Secret: Shown only once

Save Your Secret Key

Razorpay shows the secret key only once during generation. Save it immediately in a secure location. If lost, you'll need to regenerate keys.

Step 2: Install Razorpay Module

Razorpay provides an official WHMCS module:

  1. Download from Razorpay GitHub
  2. Extract the archive
  3. Upload razorpay folder to /modules/gateways/
  4. Upload razorpay.php callback to /modules/gateways/callback/

# Installation commands

cd /path/to/whmcs/modules/gateways/
wget https://github.com/razorpay/razorpay-whmcs/archive/master.zip
unzip master.zip
cp -r razorpay-whmcs-master/razorpay .
cp razorpay-whmcs-master/razorpay.php callback/
rm -rf master.zip razorpay-whmcs-master

Step 3: Configure in WHMCS

  1. Go to Setup → Payments → Payment Gateways
  2. Click All Payment Gateways
  3. Find and select Razorpay
  4. Enter your configuration:
    • Key ID: Your Razorpay Key ID
    • Key Secret: Your Razorpay Secret
    • Display Name: "Pay with Razorpay" or similar
  5. Click Save Changes

Step 4: Configure Webhooks

Webhooks ensure payment status updates are received correctly:

  1. In Razorpay Dashboard, go to Settings → Webhooks
  2. Click Add New Webhook
  3. Enter Webhook URL: https://yourdomain.com/modules/gateways/callback/razorpay.php
  4. Create a Secret (note it down)
  5. Select events:
    • payment.authorized
    • payment.captured
    • payment.failed
    • subscription.charged
    • subscription.cancelled

Enabling UPI Payments

UPI is essential for Indian customers:

  • UPI is enabled by default in Razorpay
  • Supports all UPI apps: Google Pay, PhonePe, Paytm, BHIM, etc.
  • QR code and VPA (UPI ID) options available
  • Instant payment confirmation

UPI AutoPay for Subscriptions

Razorpay supports UPI AutoPay for recurring payments. Customers authorize once, and subsequent renewals are charged automatically. Perfect for hosting subscriptions!

Subscription/Recurring Billing

Set up recurring billing for hosting products:

Enable Subscriptions in Module

Update the Razorpay module configuration:

  • Enable Subscriptions: Yes
  • Subscription Webhook Secret: Enter from Razorpay Dashboard

Razorpay Subscription Plans

For subscriptions to work, create plans in Razorpay:

  1. Go to Razorpay Dashboard → Subscriptions → Plans
  2. Create plans matching your WHMCS billing cycles
  3. Note the Plan IDs for configuration

GST Configuration

Indian tax compliance requires proper GST setup:

In Razorpay Dashboard

  1. Go to Settings → Business Details
  2. Enter your GST number
  3. Configure GST rate (typically 18% for IT services)

In WHMCS

  1. Go to Setup → Payments → Tax Rules
  2. Add GST tax rule for India (18%)
  3. Apply to relevant products

Testing Your Integration

Use Razorpay test mode:

Test Card Numbers

Scenario Card Number
Successful payment 4111 1111 1111 1111
Failed payment 4000 0000 0000 0002

Use any future expiry and any CVV in test mode.

Test UPI

In test mode, use:

  • VPA: success@razorpay for successful payment
  • VPA: failure@razorpay for failed payment

Troubleshooting

Payments Not Updating in WHMCS

  • Verify webhook URL is accessible
  • Check webhook secret matches
  • Review Razorpay webhook logs for delivery status
  • Check WHMCS gateway log for received webhooks

UPI Timeout Issues

UPI payments have a 5-minute timeout. If customers face issues:

  • Advise them to keep payment page open
  • Don't refresh until payment completes
  • Check webhook for actual payment status

Subscription Creation Failing

  • Verify Plan ID exists in Razorpay
  • Check billing cycle matches Razorpay plan
  • Ensure customer email is valid

Going Live

  1. Complete KYC verification in Razorpay
  2. Request live mode access
  3. Generate live API keys
  4. Update WHMCS with live credentials
  5. Create new webhook with live endpoint
  6. Test with a small real transaction

Razorpay Fees (2024)

Payment Method Fee
UPI 0% (below ₹2,000) / 2% (above)
Debit Cards 2%
Credit Cards 2%
Net Banking 2%
Wallets 2%

+ 18% GST on fees. Volume discounts available.

Conclusion

Razorpay integration is essential for WHMCS installations serving Indian customers. With UPI support, competitive fees, and excellent subscription handling, it provides everything you need for a successful hosting business in India. Follow this guide carefully, test thoroughly in sandbox mode, and you'll have a reliable payment solution for your customers.

Need Razorpay Integration Help?

I specialize in WHMCS payment gateway integrations for Indian businesses. Let me help you set up Razorpay with all features working perfectly.

Get Razorpay Integration Help
Share this article:
Shahid Malla

About Shahid Malla

Expert

Full Stack Developer with 10+ years of experience in WHMCS development, WordPress, and server management. Trusted by 600+ clients worldwide for hosting automation and custom solutions.