← Back to Blog

A Step-by-Step Guide to Integrating Payment Gateways (Razorpay & Stripe) in WooCommerce

By WovLab Team | March 05, 2026 | 6 min read

Why Choosing the Right Payment Gateway is Critical for Your E-commerce Success

Figuring out how to integrate payment gateway in woocommerce is more than just a technical step; it's a strategic business decision that directly impacts your revenue and customer trust. A seamless payment experience can be the deciding factor between a completed sale and an abandoned cart. Industry data consistently shows that a complicated or untrustworthy checkout process is a primary driver of cart abandonment, with some studies suggesting it accounts for over 20% of lost sales. Choosing the right gateway ensures your customers feel secure, have access to their preferred payment methods, and can complete their purchase with minimal friction. For businesses in India, this means supporting popular options like UPI, Net Banking, and wallets alongside traditional credit and debit cards. For those selling internationally, it means reliably accepting foreign currencies and credit cards. Furthermore, your choice affects your operational efficiency. Factors like transaction discount rates (TDR), settlement times, and the quality of dashboard reporting all have a direct impact on your daily cash flow and your ability to reconcile finances. A poor choice can lead to high costs, delayed access to funds, and administrative headaches.

Pre-Integration Checklist: What You Need Before You Start

Before you dive into the technical steps, a bit of preparation will ensure a smooth and successful integration process. Rushing this stage often leads to configuration errors and frustrating delays. Treat this as your foundational work. Here’s a checklist of non-negotiables to have in place before you write a single line of code or install a plugin:

Step-by-Step: Integrating Razorpay with Your WooCommerce Store

Razorpay is a top choice for Indian businesses due to its excellent support for local payment methods and competitive pricing. This section provides a detailed walkthrough on how to integrate payment gateway in woocommerce using the official Razorpay plugin. Follow these steps precisely to ensure a robust setup.

  1. Install the Official Plugin: From your WordPress dashboard, navigate to Plugins > Add New. In the search bar, type "Razorpay for WooCommerce". The official plugin, usually developed by Team Razorpay, should be the first result. Click Install Now and then Activate.
  2. Access Payment Settings: Once activated, go to WooCommerce > Settings and click on the Payments tab. You will now see "Razorpay" in the list of available gateways.
  3. Configure API Credentials: Click Manage next to the Razorpay option. The first and most crucial step here is to enter your API credentials. Copy the Key ID and Key Secret from your Razorpay Dashboard (under Settings > API Keys) into the corresponding fields in WooCommerce. Ensure you are using the correct set of keys (Test or Live). It's highly recommended to start with Test keys.
  4. Customize Checkout Options: In the same settings page, you can customize the user experience.
    • Enable/Disable: Check the box to enable Razorpay as a payment option.
    • Title: This is the text the customer sees at checkout (e.g., "Pay with Card / UPI / Netbanking").
    • Description: A brief explanation shown below the title.
    • Payment Action: Choose "Authorize" to check for funds and block them, then capture later, or "Capture" to immediately capture the payment. For most digital goods and immediate fulfillment, "Capture" is standard.
  5. Set Up Webhooks for Reliability: This step is critical and often missed. Webhooks are how Razorpay communicates with your store asynchronously to confirm payment status, especially for UPI or redirect-based payments. In your Razorpay settings in WooCommerce, you will find a Webhook URL. Copy it. Now, go to your Razorpay Dashboard, navigate to Settings > Webhooks, click Add New Webhook, paste the URL, and ensure you activate the `payment.captured`, `order.paid`, and `refund.processed` events.
Expert Insight: Never skip the webhook setup. Without it, you risk a scenario where a customer's payment is successful, but their order remains "Pending payment" in WooCommerce. This leads to manual verification work and poor customer experience. Webhooks automate this handshake, ensuring order statuses are updated in real-time.

Step-by-Step: Integrating Stripe for International Customers

While Razorpay is excellent for India, Stripe is the gold standard for accepting international payments, offering a seamless experience for customers in the US, Europe, and beyond. Its powerful currency conversion and simple fee structure make it ideal for global expansion. Here’s how to set it up.

  1. Install the Official Stripe Plugin: In your WordPress dashboard, go to Plugins > Add New. Search for "WooCommerce Stripe Payment Gateway". The official plugin is maintained by WooCommerce. Click Install Now and then Activate.
  2. Connect Your Stripe Account: Navigate to WooCommerce > Settings > Payments. Find "Stripe - Card Processing" and click Manage. Unlike many gateways that require manual key entry, Stripe's official plugin has a secure and simplified setup. Click the "Create or connect an account" button. This will redirect you to Stripe's website to securely authorize the connection with your store without ever exposing your secret keys.
  3. Configure Payment Methods: Once connected, you can enable various payment methods. The primary one is "Stripe - Card Processing". You should also enable the "new checkout experience" if prompted, as it provides a more modern and integrated payment form (Stripe Elements). You can also enable express payment options like Apple Pay and Google Pay with a single click, which can dramatically improve conversion rates on mobile devices.
  4. Verify Webhook Configuration: The official Stripe plugin attempts to configure webhooks automatically. To verify this, go to your Stripe settings within WooCommerce and look for the webhook endpoint URL. It will tell you if the webhook is correctly set up. If not, copy the URL provided. Go to your Stripe Dashboard, navigate to Developers > Webhooks, click Add endpoint, paste the URL, and have it listen for all `charge` and `payment_intent` events to be safe.
  5. Test in Test Mode: Before going live, ensure the "Enable Test Mode" checkbox is ticked in the plugin settings. Use Stripe's official test card numbers to run a few test transactions with different currencies to ensure everything from payment to order confirmation is working as expected.

Comparison Table: Razorpay vs. Stripe for an Indian Business

Feature Razorpay Stripe
Best For Domestic (Indian) payments International payments & SaaS
Key Currencies Primarily INR, with some international card support Over 135 currencies supported with auto-conversion
Popular Local Methods Extensive support for UPI, Wallets, EMI, PayLater, Netbanking Good card support, with growing but less extensive local method support

Ready to Get Started?

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

💬 Chat on WhatsApp