Setting up a reliable payment gateway is crucial for any e-commerce website. If you’re running a WooCommerce store and targeting Indian customers, Razorpay is one of the most popular and trusted payment solutions available. This comprehensive guide will walk you through how to integrate Razorpay with WooCommerce websites.
Razorpay is India’s leading payment gateway, enabling businesses to accept, process, and disburse payments online. It supports over 100 payment methods, including credit and debit cards, net banking, UPI, and popular digital wallets such as Paytm, PhonePe, and Google Pay.
Key Benefits of Using Razorpay with WooCommerce
- Wide Payment Options: Supports 100+ payment methods
- Instant Settlements: Get your money faster with instant settlement options
- Advanced Security: PCI DSS Level 1 compliant with advanced fraud detection
- Easy Integration: Simple setup process with WooCommerce
- Competitive Pricing: Transparent pricing with no hidden fees
- Excellent Support: 24/7 customer support in multiple languages
Prerequisites
Before starting the integration process, ensure you have:
- A live WooCommerce website with WordPress admin access
- An active Razorpay merchant account
- Basic understanding of WordPress dashboard navigation
- SSL certificate installed on your website (mandatory for payment processing)
Step 1: Create a Razorpay Account
If you don’t already have a Razorpay account:
- Visit the Razorpay website and click on “Sign Up”
- Complete the registration process with your business details
- Submit the required KYC documents
- Wait for account activation (usually takes 24-48 hours)
Step 2: Install the Razorpay WooCommerce Plugin
There are two ways to install the Razorpay plugin:
Method 1: Install from WordPress Dashboard
- Log in to your WordPress admin panel
- Navigate to Plugins → Add New
- Search for “Razorpay for WooCommerce”
- Click Install Now on the official Razorpay plugin
- Click Activate after installation
Method 2: Manual Installation
- Download the plugin from the WordPress plugin repository
- Go to Plugins → Add New → Upload Plugin
- Choose the downloaded ZIP file and click Install Now
- Activate the plugin
Step 3: Configure Razorpay API Keys
Getting Your API Keys
- Log in to your Razorpay Dashboard
- Navigate to Settings → API Keys
- Click on Generate Key (if not already generated)
- Note down your Key ID and Key Secret
- For live transactions, generate keys from the Live mode
Adding API Keys to WooCommerce
- In your WordPress admin, go to WooCommerce → Settings
- Click on the Payments tab
- Find Razorpay in the payment methods list and click Set up
- Configure the following settings:
Basic Settings:
- Enable/Disable: Check to enable Razorpay
- Title: Enter the payment method title (e.g., “Pay with Card/Net Banking/UPI”)
- Description: Add a description customers will see
- Key ID: Paste your Razorpay Key ID
- Key Secret: Paste your Razorpay Key Secret
Advanced Settings:
- Payment Action: Select “Capture” for immediate payment capture
- Order Status: Choose the order status after successful payment
- Enable Test Mode: Enable for testing, disable for live transactions
Step 4: Configure Webhook (Important for Security)
Webhooks ensure your website receives real-time payment status updates:
- In Razorpay Dashboard, go to Settings → Webhooks
- Click Add New Webhook
- Enter your webhook URL:
https://yourwebsite.com/?wc-api=razorpay_webhook - Select events:
payment.authorized,payment.failed,payment.captured - Enter a Secret (remember this for WordPress configuration)
- Save the webhook
Configure Webhook in WordPress
- Return to WooCommerce Razorpay settings
- Enter the Webhook Secret you created
- Save settings
Step 5: Test the Integration
Enable Test Mode
- In Razorpay settings, enable Test Mode
- Use test API keys from your Razorpay dashboard
- Save settings
Perform Test Transactions
- Visit your website and add products to cart
- Proceed to checkout
- Select Razorpay as payment method
- Use test card details:
- Card Number: 4111 1111 1111 1111
- Expiry: Any future date
- CVV: Any 3-digit number
- Complete the test transaction
Step 6: Go Live
Once testing is successful:
- Switch to Live Mode in Razorpay dashboard
- Generate live API keys
- Update WordPress settings with live keys
- Disable Test Mode in WooCommerce settings
- Save all settings
Troubleshooting Common Issues
Issue 1: Payment Failures
- Verify API keys are correct and from the right mode (Test/Live)
- Ensure SSL certificate is properly installed
- Check if webhook URL is accessible
Issue 2: Orders Not Updating
- Verify webhook configuration
- Check webhook secret matches in both dashboards
- Ensure webhook URL is correct
Issue 3: Plugin Conflicts
- Deactivate other payment plugins temporarily
- Check for JavaScript errors in browser console
- Update WooCommerce and WordPress to latest versions
Security Best Practices
- Always Use HTTPS: Never process payments on HTTP websites
- Keep Plugins Updated: Regularly update WooCommerce and Razorpay plugin
- Secure API Keys: Never share API keys publicly
- Regular Backups: Backup your website before making changes
- Monitor Transactions: Regularly check Razorpay dashboard for any anomalies
Optimizing for Better Conversion
- Clear Payment Options: Display all available payment methods clearly
- Trust Signals: Show security badges and SSL certificates
- Mobile Optimization: Ensure smooth mobile payment experience
- Fast Loading: Optimize website speed for better user experience
- Guest Checkout: Allow customers to checkout without registration
Conclusion
Integrating Razorpay with WooCommerce is a straightforward process that can significantly boost your online sales by offering customers their preferred payment methods. The combination of Razorpay’s robust payment infrastructure and WooCommerce’s e-commerce capabilities provides a powerful solution for Indian businesses.
Remember to thoroughly test the integration before going live, and always prioritize security by using HTTPS and keeping your plugins updated. With proper setup and configuration, you’ll have a reliable payment system that enhances your customers’ shopping experience.
Need Help?
If you encounter any issues during integration:
- Check the official Razorpay documentation
- Contact Razorpay support through their dashboard
- Consult WooCommerce support forums
- Consider hiring a WordPress developer for complex customizations
Happy selling!



