Payments
Payment gateway integration services for websites, apps and portals
Payment gateway integration services connect your website, app or portal to a gateway such as Razorpay, PayU, Cashfree or Stripe, so customers can pay and every payment, refund and settlement is recorded correctly in your own system. Codebrix builds the checkout, the server-side checks, webhooks, refunds and a daily reconciliation, in a merchant account that belongs to your company. Pricing is shared on a call within an hour of your enquiry.
- Gateways
- Razorpay, PayU, Cashfree, Stripe
- Merchant account
- In your company's name
- Checked daily
- Orders against settlements
- Pricing
- On a call within 1 hour
Updated · By the Codebrix team
Choosing a gateway: Razorpay, PayU, Cashfree or Stripe
All four accept the common Indian payment methods, so the choice usually turns on fees for your payment mix, settlement terms, the extra products you need and how quickly your account is approved. The notes below come from each provider's own pages in November 2026.
| Gateway | Worth a look when | Check before you commit |
|---|---|---|
| Razorpay | You want UPI, cards, netbanking, wallets and EMI from one Indian provider | Its Route product for splitting payments asks domestic businesses for turnover above ₹40 lakh in the current or preceding financial year |
| PayU | You want a standard plan with no setup or annual maintenance fee | EMI, Amex, Diners and international cards sit in a higher fee slab, and UPI pricing varies by business type and volume |
| Cashfree | You want UPI, cards, wallets and bank transfer, plus subscriptions | Read the current new-merchant offer terms, which exclude several card types |
| Stripe India | You sell to customers abroad and want Stripe's tools | The standard plan page asks Indian businesses to request an invite |
Fees per payment are compared side by side in our payment gateway integration cost guide. Selling mainly to US customers through Stripe is a different job, described on Stripe integration services. For UAE gateways, see payment gateway integration in the UAE.
The server-side checks that stop fake or double payments
Each gateway has its own steps, but the logic is the same. Razorpay's standard checkout guide is a good example of what a correct flow looks like:
- Create an order on your server for every payment. Razorpay states that payments made without an order ID cannot be captured and are refunded automatically.
- Open checkout with that order ID, so the amount comes from your server, not the browser.
- When checkout reports success, compute an HMAC SHA256 digest of your stored order ID and the payment ID using your secret key, and compare it with the signature returned. Razorpay calls this a mandatory step before fulfilment.
- Use the order ID saved on your server, not the one returned by checkout, as Razorpay's guide instructs.
- Make sure payments are captured. Razorpay's capture settings say authorised payments must be captured within 3 days of creation, and with manual capture, payments not captured in time are refunded automatically.
Secret keys live only on the server and in your secrets store, never in an app bundle or front-end code. Every request that creates or changes money carries a reference that makes a repeat harmless, so a network retry cannot charge a customer twice.
Webhooks: retries, duplicates and events that arrive out of order
A payment often settles after the customer has left the page: the bank confirms late, a UPI app times out, a refund completes. The gateway tells you through a webhook, and each gateway behaves a little differently.
| Razorpay | Cashfree | Stripe | |
|---|---|---|---|
| Proving the sender | Signature verification is supported | Signature in x-webhook-signature, built with HMAC SHA256 over the timestamp and the raw payload | Stripe-Signature header, verified against the raw body |
| Retries | Exponential backoff for 24 hours; the webhook is disabled if it keeps failing for 24 hours | By default three retries, at 2, 10 and 30 minutes | Up to three days in live mode |
| Duplicates | The same event can arrive more than once; x-razorpay-event-id is unique per event | At-least-once delivery, with an idempotency header on newer webhook versions | Log processed event IDs and skip repeats |
| Order | Events may not arrive in order | Treat as unordered | Order is not guaranteed |
| Response | Reply with a 2xx within 5 seconds | Retries until a 200 response | Return a 2xx before any slow work |
- Read the raw request body and verify the signature before parsing anything.
- Store the event, reply with a 2xx at once and process it from a queue.
- Record each event ID and ignore repeats.
- When events arrive out of order, fetch the payment's current state from the gateway's API instead of trusting the sequence.
- Alert someone when a webhook endpoint starts failing, before the gateway disables it.
Sources: Razorpay webhook best practices, Cashfree webhooks and Stripe webhooks.
Refunds, partial refunds and the admin screen
Refunds deserve a proper screen, because they are where staff make costly mistakes. Razorpay's refunds documentation says a normal refund reaches the customer within 5-7 working days, an instant refund almost immediately but can fail because of the customer's bank, several partial refunds are allowed up to the captured amount, and normal refunds are not possible on payments more than 6 months old.
- Refunds start from the order in your admin, so the record and the money move together.
- Each refund needs a reason, and amounts above a limit you set need a second person's approval.
- Partial refunds show what remains refundable.
- The customer gets an email or WhatsApp message with the refund reference.
- A refund that fails at the bank shows as failed, with the next step for staff.
Reconciliation: matching orders, payments and bank settlements
Money does not reach your bank at the moment of payment. Razorpay's settlements page gives a standard cycle of T+2 working days for domestic payments and T+7 for international ones, and says the settled amount is reduced by Razorpay's fee, GST on that fee, refunds and adjustments. A daily job compares three records so nothing slips.
| Check | Compares | Catches |
|---|---|---|
| Paid orders | Your orders marked paid against captured payments at the gateway | Orders fulfilled without payment, or payments with no order |
| Refunds | Refunds in your admin against refunds at the gateway | Refunds made in the dashboard and never recorded |
| Settlements | Settlement reports against bank credits | Short or missing settlements and unexpected deductions |
| Fees | Fee and tax per payment against the rate you agreed | Wrong pricing applied to your account |
Testing, go-live and how pricing works
Everything is built against the gateway's test mode first. A sensible test list covers a successful payment, a decline, a customer who closes the page mid-payment, a duplicate webhook, a late webhook, a partial refund and a failed refund. Our software testing services page explains how such cases are scripted and repeated before each release. Going live is a switch to live keys followed by a small real payment and refund by your own team.
Payment gateway integration is often one part of a larger build, such as an ecommerce app or a fintech app. On its own, the effort depends on how many platforms take payment, how many gateways you use, refunds, subscriptions, split payments and reconciliation. We do not publish prices. Describe the flows in the enquiry form; the team calls back within an hour, at any hour, 7 days a week, shares pricing on that call and then sends a written fixed-price proposal with milestones. Gateway approval of your merchant account is on the provider's side and can move the schedule.
Frequently asked questions
What do payment gateway integration services include?
A complete job covers creating orders on the server, the checkout itself, signature verification before an order is marked paid, webhook handling for late or repeated events, full and partial refunds from your admin, a daily reconciliation of orders against payments and settlements, and test runs of every failure case. The merchant account, keys and dashboard stay in your company's name.
Which payment gateway is best for a website in India?
There is no single best one. Razorpay, PayU and Cashfree all take UPI, cards and wallets; the right choice depends on your payment mix, the fees for it, settlement terms, extra products such as subscriptions or split payments, and how quickly your account is approved. Compare the published rate cards against your own last three months of sales.
Do I need a developer to integrate Razorpay?
For a payment link or a hosted payment page, often not. For a checkout inside your own site or app, yes: Razorpay's own guide requires an order created on your server and a signature check on your server before you fulfil the order. Webhooks, refunds and reconciliation also need server code that someone maintains.
Why does a payment show failed when the customer was charged?
Usually because the site trusted the browser's message and the customer closed the page, lost signal or the bank confirmed late. The fix is a webhook handler that updates the order when the gateway's event arrives, plus a check of the payment's current status through the gateway's API. A daily reconciliation catches any case both missed.
Can one website use two payment gateways?
Yes. A common setup uses an Indian gateway for UPI and domestic cards and a second provider for international cards, or keeps a second Indian gateway as a fallback. Each gateway needs its own verification, webhooks, refunds and reconciliation, so two gateways cost more to build and to maintain than one.
How do refunds work after payment gateway integration?
Staff start a full or partial refund from the order in your admin screen, with a reason, and the system calls the gateway's refund API and records the result. Razorpay says normal refunds reach customers within 5-7 working days and instant refunds almost immediately, as of November 2026. Failed refunds show clearly so staff can act.
Sources
- Razorpay pricing
- Razorpay docs: Route
- Razorpay docs: Standard checkout integration steps
- Razorpay docs: Capture settings
- Razorpay docs: Webhook best practices
- Razorpay docs: Refunds
- Razorpay docs: Settlements
- PayU pricing
- Cashfree payment gateway charges
- Cashfree docs: Webhooks
- Stripe India pricing
- Stripe docs: Webhooks
Related
Cost guide
Payment gateway integration cost: the build and the fee on every payment
Payment gateway integration cost has two parts: the build and the fee on every payment. Razorpay, PayU, Cashfree and Stripe India fees compared, dated.
Read morePayments, US
Stripe integration services: Checkout, Billing, Connect and webhooks done properly
Stripe integration services for US companies: Checkout or Elements, Billing, webhooks, Stripe Tax and Connect, built in your own Stripe account and tested.
Read moreShopping apps
Ecommerce app development: a shopping app for the store you already run
Ecommerce app development for iOS and Android: a shopping app on your Shopify store or a custom backend, with push, payments and accounts in your name.
Read moreFintech apps
Fintech app development for payments, lending, wallet and investing products
Fintech app development for payments, lending, wallets and investing, built around your regulated partner, RBI rules and a reconciled ledger. Fixed price.
Read moreMarketplace apps
Marketplace app development: buyers, sellers, payouts and the rules between them
Marketplace app development company for multi-vendor platforms: seller KYC, split payouts via Razorpay Route or Stripe Connect, commissions and disputes.
Read moreWeb applications
Custom web application development services for portals, dashboards and internal tools
Web application development services for portals, dashboards and internal tools: roles, Postgres, integrations and tests. Fixed price, code in your name.
Read more