Available in🇮🇳 India
Keep the order open after payment.failed and accept a later success on it. A payment with no bank response is marked failed after about 10 minutes, but Razorpay keeps polling the bank for up to 3 days — it can turn authorized later. Capture manually only inside your capture window; an authorized payment you do not capture in time is auto-refunded.
Best way to integrate:
- Create one order per purchase and store its
order_idagainst your cart. Retry payments on the same order. - Drive fulfilment from the order: fulfil when it is
paid, onorder.paidorpayment.captured. - Keep the order open after
payment.failed, so the customer can retry and a late authorisation is caught. - Move states forward only; accept
failed→authorized. - Set capture to match how you fulfil: auto-capture for most businesses; manual only if you check stock or risk first.
- Reconcile any order still
createdorattemptedafter 15 minutes. - Disable the pay button once an order is
paid.
Scenarios to test your integration
Scenario details
BP-06 — Late authorisation, auto-capture on Before you start: stored events, or hand-written ones that match the live payloads. How to test: sendpayment.failed for a payment on an open order. Send payment.authorized for the same payment with late_authorized: true. Send payment.captured and order.paid.
Expected result: the order stays open after payment.failed and is fulfilled once on order.paid.
Your integration should: never close the order on payment.failed.
Live mode differs: real late authorisations cannot be simulated.
Webhooks: What Fires, and What It Lets You Decide
Every scenario above delivers a specific set of events, in a specific order. This table is the one place that says which, and — the part that actually matters — what each one entitles you to do. Most integration bugs that reach production are not missing webhooks; they are acting on the wrong one.
Before you trust any of them
- Verify the signature on every event. Replay one event to your endpoint and send one with a changed body. The replay must be ignored and the tampered event rejected. An endpoint that skips this is an open write to your order state.
- Expect duplicates. The same event can arrive more than once. Key your handler on the event ID and make it idempotent.
- Order is not guaranteed across events. Do not assume
payment.capturedlands beforeorder.paid; handle whichever arrives first. - Webhook first, callback second. The browser callback can be lost, blocked or forged. Fulfil on the webhook.
Common integration gaps to avoid
Simulate failures
Available in test mode
Not available in test mode