Razorpay - J2Commerce

Webhooks

Version: 1.0.9

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
  1. Log in to the Razorpay Dashboard and select Test Mode or Live Mode. Add one webhook in each mode.
  2. Open Account & Settings, then Webhooks, and click Add New Webhook.
  3. Paste the webhook URL for this shop.
  4. Type a long random secret and keep a copy.
  5. Set an alert email so Razorpay can warn you if the webhook keeps failing.
  6. Tick payment.captured, payment.failed, order.paid, and refund.processed.
  7. Click Create Webhook.
  8. 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_ajax&group=j2commerce&plugin=payment_razorpaycheckout&format=raw

The plugin settings also show this URL format. Replace YOUR-SITE with your domain, including any subfolder.