← Back to Blog

A Step-by-Step Guide to Integrating a Payment Gateway for Your Indian E-commerce Site

By WovLab Team | May 06, 2026 | 9 min read

Choosing the Right Payment Gateway: Razorpay vs. PayU vs. Stripe India

Selecting the correct payment gateway is the most critical first step for any Indian e-commerce business. The decision impacts everything from customer trust and conversion rates to your operational costs. While there are many options, the market is largely dominated by three major players: Razorpay, PayU, and Stripe. Understanding how to integrate a payment gateway in a website for India begins with choosing the partner that aligns with your business scale, technical capability, and target audience. Each has distinct strengths tailored for different business needs.

Razorpay has become the darling of startups and developer-first companies, thanks to its incredibly detailed documentation, easy-to-use APIs, and a modern, feature-rich dashboard. It offers a comprehensive product suite beyond just payments, including business banking (RazorpayX) and payroll. PayU (formerly PayU Money) boasts one of the largest merchant bases in India, offering competitive pricing and extensive support for a wide array of payment methods, making it a reliable workhorse for established businesses. Stripe, a global leader, brought its world-class API and developer experience to India, attracting businesses with international customers and those who prioritize a seamless, premium integration. Stripe's fee structure can be higher, but its powerful features and global recognition are significant advantages.

Choosing a gateway isn't just about the lowest transaction rate; it's about the total cost of ownership, including integration time, customer support quality, and the cost of failed transactions.

Here’s a comparative breakdown to help you decide:

Feature Razorpay PayU Stripe India
Standard TDR (Domestic) 2% on Indian Credit/Debit Cards, UPI, Wallets 2% on all payment modes 2% for RuPay, 3% for all other cards
Setup & AMC Zero Setup Fee, Zero AMC Zero Setup Fee, Zero AMC Zero Setup Fee, Zero AMC
International Payments Supported (3% + GST) Supported (3% + GST) Supported (4.3% + GST)
Best For Startups, Tech-savvy businesses, SaaS Established e-commerce, wide user base Global businesses, premium brands, complex integrations

Pre-Integration Checklist: Essential Documents and API Keys You'll Need

Before you write a single line of code, a smooth payment gateway onboarding process hinges on having your documentation and business details in order. Payment gateways are regulated financial intermediaries, and they require thorough KYC (Know Your Customer) verification. Attempting the integration without these documents ready is a common cause of significant delays. Being prepared is the first step in a successful deployment.

Gather the following documents for your business entity:

  1. Business Registration Proof: This could be your Certificate of Incorporation (for Pvt. Ltd. or OPC), Partnership Deed, or GST Certificate. It proves your business is a legitimate legal entity.
  2. PAN Card: You will need the business PAN card. For a sole proprietorship, your personal PAN card will be required.
  3. Bank Account Verification: A cancelled cheque or a recent bank statement for the business's current account. The account name must match the business name on your registration documents.
  4. Website/App Details: Your website must be live and fully functional. Crucially, it must have clear pages for Terms of Service, Privacy Policy, and Refund/Cancellation Policy. Gateways will manually review your site to ensure compliance.

Once your documents are submitted and successfully verified, the payment gateway will grant you access to the most critical components for integration: your API Keys. These typically come in a pair: a Key ID (or Public Key) and a Key Secret (or Secret Key). These keys authenticate your website's requests to the payment gateway's servers. Guard your Key Secret carefully; it should never be exposed in your front-end code.

Think of API Keys as the digital handshake between your website and the payment gateway. Without them, no transaction communication can occur. Keep your Secret Key as secure as your bank password.

Step-by-Step: How to Integrate a Payment Gateway in Website for India with WooCommerce

WooCommerce is the backbone of millions of e-commerce stores, and thankfully, all major Indian payment gateways offer dedicated plugins that make integration a breeze without deep coding. Let's walk through integrating Razorpay on a WooCommerce site, a common scenario for businesses in India. This process illustrates the general workflow you'd follow for other gateways like PayU or Stripe as well.

  1. Install the Plugin: Log in to your WordPress admin dashboard. Navigate to Plugins > Add New. In the search bar, type "Razorpay for WooCommerce". The official plugin should be the first result. Click "Install Now" and then "Activate".
  2. Navigate to Payment Settings: Once activated, go to WooCommerce > Settings and click on the Payments tab. You will now see "Razorpay" listed as a payment method.
  3. Enable and Configure: Enable the Razorpay method using the toggle. Then, click on "Manage" or "Setup" to configure its settings.
  4. Enter API Credentials: This is the most crucial step. Carefully copy the Key ID and Key Secret from your Razorpay dashboard (under the API Keys section) and paste them into the corresponding fields in the WooCommerce settings. Ensure you are using the "Live" keys for your live site.
  5. Configure Payment Action: You need to decide how payments are processed. The default is "Authorize and Capture", which means the payment is captured automatically as soon as the customer completes the transaction. Alternatively, you can choose "Authorize" to validate the payment and capture the funds manually later from your Razorpay dashboard. This is useful for businesses that need to verify stock before finalizing a sale.
  6. Customize the Checkout: The plugin allows you to customize the title and description shown to the customer during checkout. You can also enable features like custom branding and logos on the checkout popup.
  7. Save and Test: Click "Save Changes". Your Razorpay gateway is now technically live. The next, most important phase is to test it thoroughly.

This plugin-based approach is one of the simplest methods for those wondering how to integrate a payment gateway in a website for India, especially for those on the WordPress/WooCommerce platform.

From Sandbox to Live: How to Safely Test Your Payment Integration

Never test in a live environment with real money. Every reputable payment gateway provides a Sandbox or Test Mode. This is a complete, parallel environment that mirrors the live gateway but uses dummy money. Thoroughly testing here ensures a flawless customer experience when you go live and prevents financial reconciliation nightmares.

The core principle of testing is to simulate every possible scenario, not just the "happy path."

  1. Activate Test Mode: In your payment gateway's dashboard (Razorpay, PayU, Stripe), switch from "Live Mode" to "Test Mode". This will generate a separate set of test API keys (Test Key ID and Test Key Secret).
  2. Use Test Credentials in Your CMS: Go back to your WooCommerce (or other platform's) payment settings and replace the live API keys with these new test keys.
  3. Simulate Successful Transactions: The gateway's documentation will provide a list of test card numbers, dummy UPI IDs, and mock bank login details. Use these at your checkout to place a test order. Verify that the payment goes through, the customer is redirected to your "Thank You" page, and the order is marked as "Processing" in your WooCommerce admin panel.
  4. Simulate Failed Transactions: This is just as important. Use the specific test card numbers provided to simulate failures like "Insufficient Funds," "Incorrect CVV," or "Authentication Failed." Ensure your website provides a clear error message to the user and allows them to try again, rather than leaving them on a broken page.
  5. Verify in Gateway Dashboard: Log in to your gateway's test dashboard. You should see all your test transactions recorded there, matching the amounts and statuses from your website.
  6. Check Order Notes and Statuses: Dive into the specific order details in WooCommerce. The integration should add notes detailing the payment ID and status, which is invaluable for debugging customer issues later.
A common mistake is only testing successful payments. A robust integration handles failure gracefully. What your customer sees when their payment fails is a critical part of their user experience.

Once you have successfully tested all success and failure scenarios, you can confidently switch back to your Live API keys and begin accepting real payments.

Avoiding Common Pitfalls: Failed Payments, High Fees, and Security Risks

A successful integration isn't just about making the code work. It’s about building a reliable and cost-effective revenue channel. Unfortunately, many businesses stumble into common traps long after the technical setup is complete. Being aware of these pitfalls from the start can save you money, time, and customer frustration.

The Challenge of Failed Payments: A significant portion of cart abandonments in India happens at the payment stage. Reasons range from poor internet connectivity and bank server downtime to complex two-factor authentication flows.

The Hidden Cost of High Fees: Don't be swayed by a low headline TDR (Transaction Discount Rate). The true cost includes other fees.

Navigating Security and Compliance Risks: Handling payments means handling sensitive data. A security breach can be fatal for a small business.

Your goal is not just to accept payments, but to maximize successful transactions. This means choosing a secure, reliable gateway and optimizing the entire checkout experience for your specific customer base.

Streamline Your Sales: Get Expert Payment Gateway Integration from WovLab

As we've seen, figuring out how to integrate a payment gateway in a website for India involves more than just plugging in an API key. It's a strategic business decision that impacts your revenue, customer trust, and operational efficiency. Choosing the wrong partner, a poor implementation, or failing to optimize for cost and success rates can leave significant money on the table.

This is where expert guidance becomes invaluable. At WovLab, we are more than just developers; we are digital growth partners. Our team has extensive, hands-on experience integrating all major Indian payment gateways—Razorpay, PayU, Stripe, and more—for businesses across various industries. We've navigated the documentation, debugged the edge cases, and optimized the checkout flows countless times.

When you partner with WovLab for your payment integration, you get:

Stop wrestling with API documentation and compliance checklists. Focus on what you do best—running your business—and let WovLab build the robust, secure, and efficient payment infrastructure you need to succeed in the competitive Indian market. Contact us today to streamline your sales.

Ready to Get Started?

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

💬 Chat on WhatsApp