Short answer: a correct Razorpay integration creates the order on your server, opens Razorpay Checkout in the browser, verifies the payment signature on the server, and also listens to webhooks — so an order is confirmed even if the customer closes the page before returning to your site.
How the flow works
- Create an order (server): your backend calls Razorpay's Orders API with the amount and receipt ID.
- Open Checkout (browser): the customer pays by UPI, card, net banking or wallet.
- Verify signature (server): confirm the payment response really came from Razorpay before marking the order paid.
- Webhooks (server): receive payment.captured and related events as the source of truth.
- Confirm and notify: update the order, send email/WhatsApp, reduce stock.
Common mistakes we fix
| Mistake | What goes wrong | Fix |
|---|---|---|
| Trusting the browser only | Paid orders stay "pending" if the tab closes | Add webhooks |
| No signature check | Fake success responses can be submitted | Verify HMAC signature server-side |
| Amount from the browser | Price can be tampered with | Calculate the amount on the server |
| Keys in front-end code | Secret key leaked | Keep the secret key only on the server |
| No idempotency | Duplicate orders on retries | Process each payment ID once |
Fees and settlement
Razorpay charges a percentage per transaction that varies by payment method and plan, and settles to your bank account on a schedule. Always check the current Razorpay pricing before quoting margins.
Wallets, subscriptions and apps
Wallet top-ups, savings-scheme instalments and in-app payments need extra care: clear ledgers, refunds, and — inside Android apps — Google Play's payments policy. We built wallet and scheme flows for Narayan Jewellers and wallet recharges for The Fortune Pathway.
Testing checklist before going live
- Successful payment by UPI, card and net banking in test mode.
- Failed and cancelled payments leave the order unpaid and clearly marked.
- Closing the browser after paying still confirms the order via webhook.
- Duplicate webhook deliveries do not create duplicate orders.
- Refund flow updates the order and notifies the customer.
- Live keys swapped in only after all tests pass.
Need it done?
See our e-commerce development and API integration services.
Frequently asked questions
Can Razorpay be added to an existing PHP website?
Yes. It needs server-side order creation, signature verification and a webhook endpoint added to your code.
Do I need a company to use Razorpay?
Razorpay supports several business types; check their onboarding requirements for your situation.
Sources & references
| Source | Checked |
|---|---|
| Razorpay Docs — Standard Checkout | Oct 2026 |
| Razorpay Docs — Webhooks | Oct 2026 |
| Razorpay Pricing | Oct 2026 |
Prices in this article are approximate. Spotted an error? Email admin@2ndcode.com — see our editorial policy.