Before You Integrate a Payment Gateway: A Checklist for Indian Teams

Payment gateway integration looks like a two-day sprint task until the first chargeback or the first month-end close. Here is what to settle on security, fees, testing and reconciliation before you write the checkout code.

On this page
  1. Security: decide how much card data you want to touch
  2. Practical security requirements, not hygiene theatre
  3. Fees: model the total cost, not the headline rate
  4. Testing: the sandbox is not production
  5. Reconciliation: the work that starts after the payment succeeds
  6. Operational questions worth asking the vendor

Payment gateway integration usually arrives on a sprint board as a small ticket: add the SDK, drop in the key, show a button, done. In practice it is a decision with a long tail — it shapes your PCI scope, your effective cost per rupee collected, your failure rate at checkout, and how many hours your finance team spends matching transactions at month-end. The code is the easy part. What follows is what experienced teams wish they had settled before the first commit.

Security: decide how much card data you want to touch

The single biggest architectural choice is whether card data ever passes through your servers. A hosted checkout or redirect flow keeps you at the shallow end of PCI DSS scope, because the payment page is served by the gateway. A custom card form built with direct API calls pulls your application into a much deeper scope, with a heavier self-assessment questionnaire and more evidence to maintain at audit time. Neither choice is wrong, but the first one should be made deliberately, not by whoever copy-pasted the quickstart.

Practical security requirements, not hygiene theatre

  • Never store raw card numbers. RBI's card-on-file tokenisation framework means you should be persisting tokens issued by the gateway or card networks, not PANs. If a design document asks for a card table, stop and rewrite the document.
  • Verify webhooks properly. Check the signature or HMAC the gateway sends, restrict to published source IPs where supported, and then re-fetch the transaction from the gateway's API or your own order record before marking anything paid. A callback payload is a notification, not proof.
  • Make every money-moving call idempotent. Network retries are normal. Without an idempotency key on capture and refund calls, a flaky connection can double-charge a customer or double-refund one.
  • Keep secrets server-side and scoped. Keys belong in a secrets manager, not in a mobile binary or a React bundle. Use separate credentials per environment, rotate them on a schedule, and give refund permissions to as few services and humans as possible.
  • Let the gateway handle authentication flows. Card payments in India require an additional factor of authentication, and international cards often trigger a 3-D Secure challenge. Test that your flow degrades gracefully when the challenge is abandoned.
  • Check data localisation. RBI's payment system data directive requires payment data to be stored in India. Confirm in writing where your gateway stores transaction data and where its support staff can view it.

Fees: model the total cost, not the headline rate

Merchants routinely compare gateways on a single advertised percentage and then get surprised by the effective rate in the settlement report. Build a small spreadsheet before you negotiate, and populate it with every line item:

  • MDR by payment method. Cards, netbanking, wallets and UPI are priced differently. UPI person-to-merchant transactions have carried a mandated zero MDR since 2020, and RuPay debit is treated similarly, so method mix changes your blended cost substantially.
  • Platform or per-transaction fees charged on top of MDR, plus settlement charges, onboarding fees and annual maintenance.
  • GST at 18% on the gateway's fee, which raises your effective cost above the quoted number. The upside is that this GST is generally available as input tax credit, so make sure invoices are raised to the correct GSTIN.
  • Refund and chargeback charges. Ask explicitly whether MDR is returned on refunds, and what a disputed transaction costs in fees plus staff time.
  • International cards attract higher rates plus currency conversion markup. Model the cross-border case separately if you sell abroad.
  • Settlement terms. T+1 versus T+2 versus instant settlement is a pricing lever. Also ask about rolling reserves or holdbacks applied to new merchants, because that is working capital you will not see for weeks.

Then compute cost as a share of revenue, not as a share of order value. For low-ticket digital products, fixed per-transaction fees can quietly consume the entire margin.

Testing: the sandbox is not production

Sandbox environments lie, politely. They rarely reproduce bank downtime, slow UPI callbacks or the specific error code a customer's issuer returns at 11 pm. Plan for the ugly paths:

  • Simulate failure modes explicitly: a timeout after the customer's account was debited, a duplicate webhook, an out-of-order event, a user closing the tab mid-redirect, a mobile network drop after tapping Pay.
  • Verify your retry logic uses backoff and idempotency keys, and that a retried capture cannot create a second order.
  • Test refunds in full and partial amounts, multiple partial refunds against one transaction, and the authorisation-capture window if you capture later.
  • Test the reconciliation of your own test ledger, so you notice mismatches before real money is involved.
  • Run a small number of real, low-value live transactions with your own cards and UPI handles before launch, then refund them. This catches configuration mistakes that sandbox never will.
  • Log requests and responses with sensitive fields redacted, so support can diagnose a failed payment without exposing card data.

Reconciliation: the work that starts after the payment succeeds

A successful checkout is not the same as cash in the bank. Between the two sit settlement cycles, fees, refunds, chargebacks and timing differences. Design for this on day one, because retrofitting reconciliation onto a growing transaction volume is painful.

Keep three sources of truth and match them daily: your order database, the gateway's transaction and settlement reports, and your bank statement. The gateway report should give you its transaction identifier, a bank reference such as a UTR for UPI or an ARN for cards, gross amount, fee, tax and net amount. Store the raw report files immutably — you will need them months later during a dispute.

Expect timing mismatches. A gateway may mark a settlement as processed while the credit lands the next working day, so your system needs a pending-settlement state rather than a binary paid/unpaid flag. Refunds and chargebacks should live in their own ledger with their own identifiers, linked back to the original transaction, so your books show gross collections and deductions instead of a single netted figure.

Automate the matching, but keep an exception queue with an owner. Set a variance threshold above which alerts fire, and reconcile at the transaction level rather than only on daily totals — a missing refund and an extra credit can cancel out in aggregate and hide both problems.

Operational questions worth asking the vendor

Confirm that the provider appears on RBI's list of authorised payment aggregators, or is a merchant-facing platform operating through one. Ask about support escalation paths and response times, uptime commitments, sandbox parity, and how much notice you get before API deprecations. Finally, put an abstraction layer between your application and the gateway's SDK. It costs a little design effort now, and it is the difference between a two-week migration and a two-quarter one later.

None of this is glamorous work. It is, however, the difference between a checkout that merely works in a demo and one that survives a festive sale, an audit and a finance close without anyone being called at midnight.

StopLord Editor Team

Engineering & Content

Practical guides from the StopLord Technologies team on web development, mobile apps, cloud, security and digital growth.

Keep reading

Let’s talk

Have a project in mind? Let’s build it together.

Tell us what you want to achieve. We will reply with honest advice, a clear scope and the next steps — no obligation.