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
- Log in to Razorpay Dashboard
- Go to Settings → API Keys
- Click Generate Key
- 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:
- Download from Razorpay GitHub
- Extract the archive
- Upload
razorpayfolder to/modules/gateways/ - Upload
razorpay.phpcallback 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
- Go to Setup → Payments → Payment Gateways
- Click All Payment Gateways
- Find and select Razorpay
- Enter your configuration:
- Key ID: Your Razorpay Key ID
- Key Secret: Your Razorpay Secret
- Display Name: "Pay with Razorpay" or similar
- Click Save Changes
Step 4: Configure Webhooks
Webhooks ensure payment status updates are received correctly:
- In Razorpay Dashboard, go to Settings → Webhooks
- Click Add New Webhook
- Enter Webhook URL:
https://yourdomain.com/modules/gateways/callback/razorpay.php - Create a Secret (note it down)
- 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:
- Go to Razorpay Dashboard → Subscriptions → Plans
- Create plans matching your WHMCS billing cycles
- Note the Plan IDs for configuration
GST Configuration
Indian tax compliance requires proper GST setup:
In Razorpay Dashboard
- Go to Settings → Business Details
- Enter your GST number
- Configure GST rate (typically 18% for IT services)
In WHMCS
- Go to Setup → Payments → Tax Rules
- Add GST tax rule for India (18%)
- 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@razorpayfor successful payment - VPA:
failure@razorpayfor 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
- Complete KYC verification in Razorpay
- Request live mode access
- Generate live API keys
- Update WHMCS with live credentials
- Create new webhook with live endpoint
- 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
About Shahid Malla
ExpertFull 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.