← Back to Blog

Step-by-Step Guide: How to Integrate Razorpay Payment Gateway in Your WooCommerce Website

By WovLab Team | April 21, 2026 | 11 min read

Why Razorpay is a Leading Payment Gateway for Indian E-commerce Businesses

For any e-commerce business operating in India, a robust and reliable payment gateway is not just a convenience, it's a fundamental necessity. When businesses look to integrate Razorpay payment gateway in WooCommerce, they are choosing a solution that has firmly established itself as a market leader. Razorpay stands out for its comprehensive suite of features tailored specifically for the Indian market, offering an unparalleled payment experience for both merchants and customers.

One of Razorpay's primary strengths is its support for an extensive range of payment methods. From the ubiquitous UPI (Unified Payments Interface) and Net Banking across all major Indian banks to credit/debit cards (Visa, MasterCard, RuPay, Amex, Diners), digital wallets (Paytm, Freecharge, Mobikwik, OlaMoney), EMIs, and even PayLater options, Razorpay ensures that virtually every customer preference is met. This wide acceptance significantly reduces cart abandonment rates, a critical factor for online retailers.

Furthermore, Razorpay offers competitive transaction fees, often ranging from 2% to 2.36% (plus GST) for domestic transactions, which is crucial for maintaining healthy profit margins in a competitive e-commerce landscape. Its fast settlement cycles, typically T+2 or T+3 working days, ensure quick access to funds. The platform also boasts a powerful API and an intuitive dashboard, making it developer-friendly and easy for merchants to manage transactions, refunds, and analytics. Advanced features like fraud detection and recurring payments further solidify its position as the go-to payment gateway for Indian e-commerce businesses seeking efficiency, security, and scalability.

Key Insight: Razorpay's deep integration with India's diverse payment ecosystem and its focus on merchant and customer experience make it an indispensable tool for e-commerce growth, directly impacting conversion rates and operational efficiency.

Prerequisites: What You'll Need Before Integrating Razorpay

Before you embark on the journey to integrate Razorpay payment gateway in WooCommerce, it's essential to ensure you have all the necessary components and access permissions in place. A prepared setup will significantly streamline the integration process, helping you avoid common roadblocks and delays. Think of these as your foundational tools, without which the integration cannot proceed smoothly.

Here’s a checklist of what you'll need:

Having these prerequisites ready will make the installation and configuration of the Razorpay plugin a straightforward task, ensuring a secure and efficient payment processing system for your online store.

The 5-Step Process to Install and Configure Razorpay on WooCommerce

Successfully integrating Razorpay into your WooCommerce store involves a straightforward, albeit critical, series of steps. By following this guide, you can confidently install and configure the Razorpay payment gateway, readying your site to accept online payments. This process ensures that your customers have a seamless checkout experience while giving you full control over your payment settings.

Step 1: Install the Razorpay WooCommerce Plugin

The first step to integrate Razorpay payment gateway in WooCommerce is to install the official plugin. Log into your WordPress admin dashboard. Navigate to Plugins > Add New. In the search bar, type "Razorpay for WooCommerce." Locate the plugin titled "Razorpay for WooCommerce" by Razorpay and click Install Now. This action downloads and unpacks the plugin files onto your server.

Step 2: Activate the Razorpay Plugin

Once the installation is complete, the "Install Now" button will change to Activate. Click this button to enable the plugin on your website. After activation, you should see a success message, and the Razorpay plugin will be listed among your active plugins. This makes Razorpay available as a payment method option within your WooCommerce settings.

Step 3: Access WooCommerce Payment Settings

Now, you need to configure the newly installed Razorpay gateway. From your WordPress dashboard, go to WooCommerce > Settings. Click on the Payments tab (or "Checkout" in older WooCommerce versions). You will see a list of available payment gateways, and "Razorpay" should now be present. Ensure that the "Enabled" toggle for Razorpay is turned on.

Step 4: Configure Razorpay API Keys and Basic Settings

Click on the Manage button next to Razorpay. Here, you'll input your critical API credentials. You will find fields for:

  1. Enable/Disable: Ensure this checkbox is ticked.
  2. Title: This is what customers see at checkout (e.g., "Credit/Debit Cards, UPI, NetBanking by Razorpay").
  3. Description: A brief explanation for customers (e.g., "Securely pay using cards, UPI, net banking, and wallets.").
  4. API Key ID: Paste your Razorpay Key ID here. For testing, use your Test Key ID; for live transactions, use your Live Key ID.
  5. API Key Secret: Paste your Razorpay Key Secret here. Again, match it with the chosen mode (Test or Live).
It is crucial to use the correct pair of Key ID and Key Secret for either Test or Live mode. Mismatched keys are a common source of errors.

Step 5: Define Advanced Settings and Save

Below the API keys, you'll find advanced settings:

  1. Payment Action: Choose "Authorize and Capture" (most common, captures funds immediately) or "Authorize" (holds funds, requires manual capture later).
  2. Webhook Secret: Configure this in your Razorpay dashboard under Settings > Webhooks, and then paste the generated secret here. This enables real-time updates for order status.
  3. Payment Page Theme Color: Customize the color of the Razorpay checkout pop-up to match your brand.
  4. Order Payment Status: Define the initial status for orders paid via Razorpay (e.g., "Processing").
  5. Customer Contact Details on Checkout: Options for displaying/hiding phone and email fields on Razorpay's checkout page.
After adjusting all settings to your preference, click the Save changes button. Your Razorpay payment gateway is now installed and configured, ready for testing.

How to Test Your Razorpay Integration with Sandbox Mode

Testing is a crucial phase after you integrate Razorpay payment gateway in WooCommerce. Before going live, you must rigorously test the entire payment flow to ensure everything works as expected, from customer checkout to order status updates in WooCommerce and transaction visibility in your Razorpay dashboard. Razorpay's **Test Mode** (also known as Sandbox Mode) provides a safe environment to simulate transactions without involving real money.

Here’s a step-by-step guide to testing your integration:

  1. Enable Test Mode in WooCommerce: Go to WooCommerce > Settings > Payments > Razorpay > Manage. Ensure you have entered your **Test API Key ID** and **Test API Key Secret** in the respective fields. Save changes.
  2. Place a Test Order:
    • Visit your WooCommerce store as a customer (preferably in an incognito window or logged out).
    • Add a product to your cart and proceed to checkout.
    • Select "Razorpay" as your payment method.
    • Fill in your billing details and click "Place Order."
  3. Use Razorpay Test Card Details: When the Razorpay payment popup appears, you'll need to use specific test card details to simulate a successful payment. Razorpay provides these:
    • Card Number: 4111 1111 1111 1111
    • Expiry Date: Any future date (e.g., 12/25)
    • CVV: Any 3-digit number (e.g., 123)
    • OTP: For OTP-required transactions, you can use "123456" for success or "222222" for failure.
    You can also test various scenarios like failed payments by using specific test card numbers or entering incorrect OTPs.
  4. Verify Order Status in WooCommerce: After completing the test payment, return to your WordPress admin. Go to WooCommerce > Orders. You should see the test order with a status of "Processing" (or whatever you configured). This confirms the order was successfully placed and communicated back to WooCommerce.
  5. Verify Transaction in Razorpay Dashboard: Log in to your Razorpay dashboard. Switch to "Test Mode" (top-left corner). Navigate to "Transactions" or "Payments." You should see the recently processed test transaction listed with its details. This confirms Razorpay is receiving and processing payments correctly.

Expert Tip: Test various scenarios, including successful payments, failed payments, and refunds. This comprehensive testing ensures your integration is robust and handles all possible outcomes gracefully.

Troubleshooting Common Razorpay & WooCommerce Integration Errors

Even after carefully following the integration steps, you might encounter issues when you integrate Razorpay payment gateway in WooCommerce. Identifying and resolving these common errors quickly is key to maintaining a smooth customer experience and uninterrupted sales. Here's a breakdown of frequent problems and their practical solutions:

Problem Symptom Solution
API Key Mismatch/Incorrect "Invalid Key ID" or "Authentication Failed" error during checkout.
  • Double-check your API Key ID and API Key Secret in WooCommerce settings against your Razorpay dashboard.
  • Ensure you're using the correct pair for the selected mode (Test keys for Test mode, Live keys for Live mode).
  • Regenerate keys in Razorpay if necessary.
Webhook Not Configured or Invalid Order status in WooCommerce doesn't update automatically after payment (remains "Pending Payment").
  • Go to Razorpay Dashboard > Settings > Webhooks > Add New Webhook.
  • Set the Webhook URL to yourdomain.com/wc-api/razorpay/ (replace yourdomain.com).
  • Add a Webhook Secret (a strong, unique string) and save it.
  • Copy this secret and paste it into the "Webhook Secret" field in WooCommerce Razorpay settings.
  • Select "payment.authorized" and "order.paid" events.
SSL Certificate Missing/Invalid Customers see "Not Secure" warning in browser or payment gateway won't load/redirect.
  • Ensure your website uses HTTPS.
  • Install a valid SSL certificate (e.g., Let's Encrypt) through your hosting provider.
  • Verify all resources load via HTTPS; check for mixed content warnings.
Plugin Conflict Unexpected behavior, errors during checkout, or Razorpay disappearing from payment options.
  • Deactivate other plugins one by one (excluding WooCommerce and Razorpay) to identify the conflicting plugin.
  • Contact the conflicting plugin developer or Razorpay support for compatibility solutions.
Outdated Software/Server Issues General errors, slow performance, or system instability.
  • Ensure your WordPress, WooCommerce, and all plugins are up to date.
  • Check your PHP version (WooCommerce recommends 7.4 or higher).
  • Review your hosting provider's error logs for server-side issues.
  • Increase PHP memory limit if needed (e.g., to 256MB or 512MB).
Firewall/Security Blocking Razorpay popup not loading, or webhook calls failing silently.
  • Check your server's firewall or security plugins (like Wordfence, Sucuri) for any blocks on Razorpay's IP addresses or domains.
  • Whitelist Razorpay's IP ranges (found in Razorpay documentation) if your server's firewall is highly restrictive.

Actionable Advice: Always check your server error logs and WooCommerce > Status > Logs for detailed error messages. These logs are often the quickest way to pinpoint the root cause of an issue.

Need Expert Help? Streamline Your Integration with WovLab's Services

While this guide provides a comprehensive roadmap to integrate Razorpay payment gateway in WooCommerce, we understand that every e-commerce setup is unique. Custom themes, a multitude of plugins, specific business logic, and unforeseen technical hurdles can sometimes make even a straightforward integration challenging. For businesses that need to ensure a flawless, secure, and optimized payment system without diverting valuable internal resources, expert assistance can be invaluable.

At WovLab (wovlab.com), we specialize in providing tailored digital solutions that empower businesses to thrive online. As a leading digital agency from India, our expertise spans across AI Agents, Development, SEO/GEO, Marketing, ERP, Cloud, Payments, Video, and Operations. Our dedicated team of developers and e-commerce specialists has extensive experience with payment gateway integrations, particularly with Razorpay and WooCommerce.

We can help you:

Don't let technical complexities hinder your sales. Partner with WovLab to ensure your Razorpay integration is not just functional, but also robust, secure, and fully aligned with your business objectives. Focus on growing your business, while we handle the intricate details of your digital infrastructure. Visit wovlab.com today to learn more about our services and schedule a consultation. Let's build a powerful and efficient e-commerce presence together.

Ready to Get Started?

Let WovLab handle it for you — zero hassle, expert execution.

💬 Chat on WhatsApp