How to make an app · Integration guide

How to add payments to your app
Razorpay vs Stripe, set up right

To add payments to an app, choose a gateway (most Indian apps use Razorpay or a similar domestic gateway; Stripe accepts Indian businesses by invite only), create each order on your server, open the gateway's checkout in the app, then confirm the payment on your server by verifying its signature and webhook — never trust the app alone. Digital goods sold inside iOS and Android apps usually must use the stores' own billing.

By , FounderUpdated 5 min read

Share

Quick answer: How do I integrate a payment gateway into my app?

  1. Choose — Razorpay or another Indian gateway for INR; Stripe is invite-only for Indian businesses.
  2. Server creates the order — the amount is decided on your server, never in the app.
  3. App opens checkout — the gateway's SDK handles UPI, cards, wallets and net banking.
  4. Server verifies — check the payment signature and listen to webhooks before fulfilling.
  5. 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.

How do I integrate a payment gateway into my app? At a glance: Choose; Server creates the order; App opens checkout; Server verifies; Check store rules.
At a glance: How do I integrate a payment gateway into my app?

Choose your gateway

Razorpay vs Stripe for apps built in India
Razorpay (and similar Indian gateways)Stripe
Availability for Indian businessesOpenInvite-only1
UPI, net banking, Indian walletsYesLimited for Indian domestic payments
Published standard pricing2% for most domestic methods2Varies by country
SubscriptionsSupportedSupported
Best forINR payments from Indian customersGlobal 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

Diagram of 7 steps for the safe payment flow: 1. App asks your server to create an order; 2. Server creates the order with the gateway; 3. App opens the gateway's checkout; 4. App sends the result to your server; 5. Server verifies the signature; 6. Server also listens to webhooks; 7. Server fulfils
The safe payment flow
  1. 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.
  2. Server creates the order with the gateway using your secret key, and returns the order ID to the app.
  3. 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.
  4. App sends the result to your server — payment ID, order ID and signature.
  5. Server verifies the signature with the secret key. Only then is the order provisionally paid.
  6. 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.
  7. 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:

Apple's and Google's rules: Physical goods and real-world services; Digital goods and subscriptions used in the app.
Apple's and Google's rules

Physical goods and real-world services

Food, rides, products, tickets, appointments, consulting — you can use your own gateway such as Razorpay.

Digital goods and subscriptions used in the app

Premium features, coins, courses, content unlocks — Apple and Google generally require their own in-app billing45, with some regional exceptions and alternative billing programmes, including options in India on Google Play.

Read the current policies before designing your pricing, because store fees change your unit economics.

Handle the unhappy paths

Checklist: Handle the unhappy paths — Payment pending; Payment failed; Charged but no order; Refunds; Duplicate taps; Receipts.
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

  1. Stripe Support — Stripe accounts are invite-only in India
  2. Razorpay — Pricing
  3. Razorpay Docs — Payment Gateway integration
  4. Apple Developer — App Store Review Guidelines (3.1 Payments)
  5. Google Play Console Help — Understanding Google Play's payments policy
  6. NPCI — UPI product statistics
  7. Checked October 23, 2026. Figures that change — fees, salaries, prices — are reviewed every six months; if something is out of date, tell us.
Pass it on

Know someone who'd enjoy this?

Send it to them — one tap, no sign-up. Good ideas travel best between friends.

Keep exploring

Where to go from here

Join free

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.

Get the free Laws of UX PDFFree · no spam · unsubscribe anytime
Before you launch

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.

Free certification

Turn what you know into a credential.

Free, test-based UX, UI and product certifications. Answer real product scenarios, graded on our server, and earn a founder-signed certificate anyone can verify and you can add to LinkedIn.

  • Credential ID
  • QR verification
  • LinkedIn-ready
Free PDF · 74 pages · 2 editions

The Laws of UX, in one field guide

60 research-backed principles in 6 categories — what each one means, why it works on the human brain and how to use it on your own screens. Written by Sushant Singh, founder of Science of Apps, who has scaled consumer apps to lacs of users and spent 10+ years leading product across startups and digital businesses in the US, EU & India.

Pick your edition
Free. No card, no paywall — just your email.
Free PDF · 74 pages

Get Laws of UX by email

Choose your edition

You’ll also get occasional UX psychology tips. Unsubscribe anytime. Privacy policy

Free PDF · 90 pages · 2 editions

100+ Subscription Paywalls, decoded

110 real paywalls from top apps, taken apart, rated out of 5 and decoded with the Laws of UX — plus the frameworks, copy and checklists to ship your own. By Sushant Singh, founder of Science of Apps.

  • 110 paywalls rated
  • 34 Laws of UX
  • 12 frameworks

Which paywall scored 4.8 out of 5, and which scored 2.6? It’s all inside.

Pick your edition
Free. No card, no paywall — just your email.
Free PDF · 90 pages

Get 100+ Paywalls, Decoded by email

Choose your edition

You’ll also get occasional UX psychology tips. Unsubscribe anytime. Privacy policy