Webhooks
Webhooks let Razorpay tell your store that a payment was captured, failed, or refunded even if the customer closes the browser.
Without a webhook, an order is confirmed only when the customer returns to your site. With one, a late UPI approval and a refund made in the Razorpay Dashboard still update the order.
Razorpay only accepts webhooks for a website domain that is verified on the account (Dashboard, Account & Settings, Business website details). Until then, payments still work and are confirmed when the customer returns. Webhooks cannot reach localhost or a site behind a password.
Add the webhook in Razorpay
- Log in to the Razorpay Dashboard and select Test Mode or Live Mode. Add one webhook in each mode.
- Open Account & Settings, then Webhooks, and click Add New Webhook.
- Paste the webhook URL for this shop.
- Type a long random secret and keep a copy.
- Set an alert email so Razorpay can warn you if the webhook keeps failing.
- Tick payment.captured, payment.failed, order.paid, and refund.processed.
- Click Create Webhook.
- Paste the same secret into the webhook secret field for that mode in the shop, and save.
order.paid is treated the same as payment.captured. Duplicate events are ignored. A request with a missing or wrong signature gets HTTP 400 and is logged as Webhook rejected. An event meant for a different shop on the same site is ignored.
Webhook URL
https://YOUR-SITE/index.php?option=com_jshopping&controller=checkout&task=step7&act=notify&js_paymentclass=pm_razorpaycheckout&no_lang=1
The Config tab of the payment method shows this URL with your domain already filled in. Replace YOUR-SITE if you copy it from this guide.