Integrating a payment gateway with WooCommerce in India involves more than installing a plugin. You need to complete the gateway’s KYC onboarding, test thoroughly in test mode, configure webhooks so orders update reliably, plan for failed payments and refunds, decide how COD fits in, and set up a routine to reconcile payments with orders. Get these right and payments become one of the least troublesome parts of running the store.
How does a gateway integration actually work?
When a customer pays, WooCommerce hands the payment to the gateway, the gateway processes it with the bank or UPI network, and then reports the result back so WooCommerce can mark the order as paid or failed.
That report back happens in two ways. The customer’s browser is redirected to your thank-you page, and the gateway also sends a server-to-server notification, usually called a webhook. The browser redirect is not reliable on its own, because customers close tabs, lose network or switch apps mid-payment. The webhook is what makes order status dependable.
What does onboarding and KYC involve?
Before you can accept live payments, the gateway verifies your business. Expect to provide business registration details, PAN, bank account information and, where applicable, your GSTIN, along with your website for review.
Gateways usually check that the website is complete and trustworthy before activation. Have these pages live and linked from the footer before you apply:
- About and contact pages with a real address, phone number and email.
- Terms and conditions.
- Privacy policy.
- Refund and cancellation policy.
- Shipping and delivery policy.
- Clear product pages with prices visible.
Missing policy pages and placeholder content are common reasons for delays. Each gateway sets its own requirements, so follow its checklist exactly.
Why test mode matters
Most gateways provide a test or sandbox mode with test keys, which lets you run transactions without moving real money. Use it to confirm the complete flow before going live.
Test at least these scenarios:
- A successful payment, with the order moving to Processing and emails sent to customer and admin.
- A failed or declined payment, with the order left in Pending or Failed and the customer able to retry.
- A payment where the customer closes the browser after paying, to confirm the webhook still updates the order.
- A full and a partial refund, if your plugin supports refunds from the WooCommerce admin.
- Each payment method you plan to offer: UPI, cards, net banking and wallets.
When you switch to live mode, replace test keys with live keys, update the webhook settings in the gateway dashboard, and place one small real order to confirm everything end to end.
Configure webhooks properly
Webhooks are the most common source of payment problems we see on WooCommerce stores, usually because they were never set up or were left pointing at a staging site.
- Register the webhook URL provided by your gateway plugin in the gateway dashboard.
- Set the webhook secret in both places so the plugin can verify that notifications are genuine.
- Subscribe to the events your plugin expects, such as payment captured, failed and refunded.
- Make sure your firewall, security plugin or caching layer does not block or cache the webhook URL.
- Check the gateway dashboard’s webhook delivery logs after launch for failed deliveries.
Keep the integration secure
Use the gateway’s official or well-maintained WooCommerce plugin, and keep it updated alongside WooCommerce itself. Hosted or redirect-based payment flows mean card details are entered on the gateway’s side rather than stored on your server, which keeps sensitive data away from your site. Never store card numbers in order notes or custom fields. Keep API keys and webhook secrets out of shared documents and emails, restrict dashboard access to the people who need it, and regenerate keys if a developer or agency with access leaves. A broken or outdated payment plugin is one of the few problems that stops revenue immediately, so treat its updates with the same care as WooCommerce core.
Handling failed payments and refunds
Failed and pending payments
Payments fail for ordinary reasons: insufficient balance, bank timeouts, a UPI request that expired, or a customer who changed their mind. Make it easy to retry. WooCommerce lets customers pay for a pending order from their account, and you can send a polite reminder with a payment link.
Also watch for the opposite case, where money was debited but the order still shows as pending. This usually points to a webhook issue. Check the gateway dashboard before contacting the customer, and fix the root cause rather than updating orders by hand every time.
Refunds
Many gateway plugins let you issue refunds directly from the WooCommerce order screen, which keeps both systems in sync. If you refund from the gateway dashboard instead, update the WooCommerce order as well. Tell customers how long refunds typically take to reach their account, based on what your gateway states, and put that in your refund policy.
UPI and cash on delivery
UPI is widely used by Indian shoppers, so make sure it is clearly visible at checkout and works well on mobile, where customers often switch to a UPI app to approve the payment and then return to the browser. Test that return journey on both Android and iPhone.
COD is handled by WooCommerce itself rather than the gateway. Decide on your rules: which pincodes, order values or products allow COD, whether you confirm COD orders by call or message before dispatch, and how you will record cash collected by your courier. Restricting COD by pincode or value usually needs a plugin or small custom code, which we often handle as part of WooCommerce development for new stores.
Reconciliation: matching money to orders
Reconciliation means confirming that every paid order has a matching settlement in your bank account, and every settlement matches an order. It catches missed webhooks, duplicate payments and refund errors early.
A simple routine works for most stores. Export settlement reports from the gateway, export orders from WooCommerce for the same period, and match them using the gateway’s payment or order ID. Ensure the payment ID is saved on each WooCommerce order so this matching is straightforward. For COD, match courier remittance reports to delivered orders. Do this weekly at minimum, and daily if order volume is high.
Key takeaways
- Complete policy pages before applying, so KYC and website review go smoothly.
- Test every payment method and failure case in test mode before going live.
- Webhooks, not browser redirects, make order status reliable.
- Plan for failed payments, refunds, UPI app switching and COD rules.
- Reconcile gateway settlements and courier remittances against orders regularly.
Next steps
Before changing anything, place a test order on your own store and follow it through to settlement to see where the gaps are. If you need help with gateway setup, webhooks, COD rules or checkout changes, our WooCommerce customization team works on exactly these details.



