How to Integrate Razorpay with WooCommerce

How to integrate Razorpay with WooCommerce in 2025

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:

  1. A live WooCommerce website with WordPress admin access
  2. An active Razorpay merchant account
  3. Basic understanding of WordPress dashboard navigation
  4. 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:

  1. Visit the Razorpay website and click on “Sign Up”
  2. Complete the registration process with your business details
  3. Submit the required KYC documents
  4. 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

  1. Log in to your WordPress admin panel
  2. Navigate to PluginsAdd New
  3. Search for “Razorpay for WooCommerce”
  4. Click Install Now on the official Razorpay plugin
  5. Click Activate after installation

Method 2: Manual Installation

  1. Download the plugin from the WordPress plugin repository
  2. Go to PluginsAdd NewUpload Plugin
  3. Choose the downloaded ZIP file and click Install Now
  4. Activate the plugin

Step 3: Configure Razorpay API Keys

Getting Your API Keys

  1. Log in to your Razorpay Dashboard
  2. Navigate to SettingsAPI Keys
  3. Click on Generate Key (if not already generated)
  4. Note down your Key ID and Key Secret
  5. For live transactions, generate keys from the Live mode

Adding API Keys to WooCommerce

  1. In your WordPress admin, go to WooCommerceSettings
  2. Click on the Payments tab
  3. Find Razorpay in the payment methods list and click Set up
  4. 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:

  1. In Razorpay Dashboard, go to SettingsWebhooks
  2. Click Add New Webhook
  3. Enter your webhook URL: https://yourwebsite.com/?wc-api=razorpay_webhook
  4. Select events: payment.authorized, payment.failed, payment.captured
  5. Enter a Secret (remember this for WordPress configuration)
  6. Save the webhook

Configure Webhook in WordPress

  1. Return to WooCommerce Razorpay settings
  2. Enter the Webhook Secret you created
  3. Save settings

Step 5: Test the Integration

Enable Test Mode

  1. In Razorpay settings, enable Test Mode
  2. Use test API keys from your Razorpay dashboard
  3. Save settings

Perform Test Transactions

  1. Visit your website and add products to cart
  2. Proceed to checkout
  3. Select Razorpay as payment method
  4. Use test card details:
    • Card Number: 4111 1111 1111 1111
    • Expiry: Any future date
    • CVV: Any 3-digit number
  5. Complete the test transaction

Step 6: Go Live

Once testing is successful:

  1. Switch to Live Mode in Razorpay dashboard
  2. Generate live API keys
  3. Update WordPress settings with live keys
  4. Disable Test Mode in WooCommerce settings
  5. 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

  1. Always Use HTTPS: Never process payments on HTTP websites
  2. Keep Plugins Updated: Regularly update WooCommerce and Razorpay plugin
  3. Secure API Keys: Never share API keys publicly
  4. Regular Backups: Backup your website before making changes
  5. Monitor Transactions: Regularly check Razorpay dashboard for any anomalies

Optimizing for Better Conversion

  1. Clear Payment Options: Display all available payment methods clearly
  2. Trust Signals: Show security badges and SSL certificates
  3. Mobile Optimization: Ensure smooth mobile payment experience
  4. Fast Loading: Optimize website speed for better user experience
  5. 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!