Quick answer: How do I integrate a payment gateway into my app?
- Choose — Razorpay or another Indian gateway for INR; Stripe is invite-only for Indian businesses.
- Server creates the order — the amount is decided on your server, never in the app.
- App opens checkout — the gateway's SDK handles UPI, cards, wallets and net banking.
- Server verifies — check the payment signature and listen to webhooks before fulfilling.
- Check store rules — digital goods in apps usually need Apple or Google billing.
Key takeaways
- The app is untrusted. Amounts, orders and payment confirmation belong on your server.
- Webhooks are the source of truth — users close apps mid-payment all the time.
- Use the gateway's hosted checkout or SDK so card data never touches your servers.
- UPI dominates Indian payments, so make it the first, fastest option in checkout.
- Physical goods and real-world services can use your gateway; in-app digital content usually cannot.
Payments are where a small bug becomes a real loss. Mark an order paid when it wasn't, and you ship free products. Miss a successful payment because the user closed the app, and you have an angry customer who was charged for nothing. Both mistakes come from the same root: trusting the app instead of the server. Here is how to set payments up properly.

Choose your gateway
| Razorpay (and similar Indian gateways) | Stripe | |
|---|---|---|
| Availability for Indian businesses | Open | Invite-only1 |
| UPI, net banking, Indian wallets | Yes | Limited for Indian domestic payments |
| Published standard pricing | 2% for most domestic methods2 | Varies by country |
| Subscriptions | Supported | Supported |
| Best for | INR payments from Indian customers | Global payments where available |
Alternatives such as Cashfree, PayU and PhonePe's payment gateway work in a similar way. Compare settlement time, subscription support, SDK quality for your stack (Android, iOS, Flutter, React Native) and support responsiveness — not just the headline rate.
UPI is the way most Indians pay digitally, with billions of transactions a month on NPCI's published statistics6. Make it the first and fastest option in your checkout.
The safe payment flow

- App asks your server to create an order for a cart or plan. The server calculates the amount from its own data — never from a number the app sends.
- Server creates the order with the gateway using your secret key, and returns the order ID to the app.
- App opens the gateway's checkout with that order ID. The gateway's SDK handles UPI, cards, wallets and net banking, so card data never touches your servers3.
- App sends the result to your server — payment ID, order ID and signature.
- Server verifies the signature with the secret key. Only then is the order provisionally paid.
- Server also listens to webhooks — the gateway tells you directly when a payment is captured, failed or refunded. This catches every user who closed the app mid-payment.
- Server fulfils the order and the app shows confirmation.
Apple's and Google's rules
The biggest surprise for first-time founders is that what you sell decides how you can charge:

Physical goods and real-world services
Food, rides, products, tickets, appointments, consulting — you can use your own gateway such as Razorpay.
Read the current policies before designing your pricing, because store fees change your unit economics.
Handle the unhappy paths

- Payment pending — UPI payments can take moments to confirm; show a clear waiting state
- Payment failed — explain simply and offer another method
- Charged but no order — webhooks plus a daily reconciliation job catch these
- Refunds — partial and full, triggered from your admin panel
- Duplicate taps — make order creation idempotent so a double tap doesn't charge twice
- Receipts — email or in-app receipts, with GST details where required
Test before launch
Use the gateway's test mode and test credentials, then run a small real payment end to end. Test on a slow network, kill the app mid-payment, and confirm the webhook still marks the order correctly.
For subscription billing in a SaaS context, see how to build a SaaS product; for sign-in, see how to add Login with Google.
Key terms, defined
Payment gateway — a service that processes online payments. Order — a server-created record of what is being paid for. Signature verification — checking cryptographically that a payment result came from the gateway. Webhook — a server-to-server notification about a payment event. Idempotency — making a repeated request have the same effect as one. In-app purchase — Apple's or Google's own billing for digital goods.
Frequently asked questions
Which payment gateway is best for an app in India?
Most Indian apps use a domestic gateway such as Razorpay, Cashfree, PayU or PhonePe's payment gateway, because they support UPI, cards, net banking and wallets with INR settlement. Compare pricing, settlement time, subscription support and SDK quality for your stack.
Can Indian businesses use Stripe?
Stripe currently accepts Indian businesses by invitation only, according to its support documentation. If you are not invited, use an Indian gateway for domestic payments and check which processors can serve you for international customers.
What are payment gateway charges in India?
Razorpay's published standard pricing is 2% per transaction for most domestic methods, with different rates for some cards, international payments and enterprise plans. Rates vary by gateway and change over time, so check each provider's pricing page.
Do I have to use Apple or Google in-app purchase?
For digital goods and subscriptions used inside the app, generally yes, under Apple's and Google Play's payment policies, with some regional exceptions and alternative billing programmes. Physical goods and services consumed outside the app — food, rides, tickets, products — can use your own gateway.
How do I verify a payment securely?
After checkout, send the payment details to your server and verify the gateway's signature using your secret key, which must never be in the app. Also handle the gateway's webhooks, and only mark an order paid once your server has confirmed it.
How long does payment gateway integration take?
A basic one-time payment flow with server verification and webhooks can take a few days for an experienced developer. Subscriptions, refunds, split payments, invoices and reconciliation take longer.
Sources
- Stripe Support — Stripe accounts are invite-only in India
- Razorpay — Pricing
- Razorpay Docs — Payment Gateway integration
- Apple Developer — App Store Review Guidelines (3.1 Payments)
- Google Play Console Help — Understanding Google Play's payments policy
- NPCI — UPI product statistics
- Checked October 23, 2026. Figures that change — fees, salaries, prices — are reviewed every six months; if something is out of date, tell us.
Where to go from here
- How to add Login with Google — the other integration every app needs
- How to build a SaaS product — subscription billing in context
- ComparisonsRazorpay vs Stripe vs Cashfree vs PayU: which payment gateway should an Indian business use?Razorpay vs Stripe vs Cashfree vs PayU for Indian businesses: fees, onboarding, UPI, subscriptions, payouts and international payments compared, with a verdict.
- ComparisonsShopify vs WooCommerce in India: costs, payments, control and effort for online storesShopify vs WooCommerce for Indian online stores: total cost, payment gateways like Razorpay, GST, apps, hosting, control and effort — with a clear verdict.
- How to make an appHow to add "Login with Google" to your appAdd Sign in with Google to Android, iOS or web: Google Cloud setup, Credential Manager or Identity Services, ID-token checks and Apple's login rule.
- App developmentApp maintenance cost: the hidden 20% nobody warns you aboutPlan 15–25% of your build cost every year to maintain an app — OS updates, store rules, bugs, security, servers. What it covers, what drives it, how to cut it.
- AI & vibe codingHow to add AI to an app: choosing features, architecture, evaluation, cost and trustHow to add AI features to an existing app: pick a user problem, choose the pattern, architecture, evaluation, cost control, privacy and UX.
- Original dataIndian app statistics 2026: subscribers, broadband, UPI, installs, startups and what top apps look likeIndian app statistics for 2026 from official and public data: 1.35 billion telecom subscribers, 24 billion UPI payments a month and top-app benchmarks.
Get the ideas, not the noise.
Sign up with Google and we’ll send you short UX psychology tips by email — why people tap, stall and leave, and what to do about it. Unsubscribe anytime. Prefer something to keep? Get the free Laws of UX guide as a PDF.
Make sure the first screen makes sense.
A behavioral UX audit of your app or SaaS product: why users hesitate, stall and leave, and a prioritized fix list. Fixed price, 2–4 weeks.





