Setup Process
Step 1: Log in to your RazorPay dashboard.
Step 2: Go to Settings > WebHooks
Step 3: Click Add New Webhook
Step 4: Here you need to enter the webhook URL:
Change domain.com to your own domain name.
Step 5: In the Secret field, set a key (this can be any key you want)
Step 6: In the Active Events field, select payment.failed and payment.captured

Step 7: Click "Create Webhook."
Step 8: Log in to your Admin Dashboard
Step 9: Go to Settings > Payment Gateways > Razorpay Webhook Secret and insert the same Secret key you set in Step 5
Step 10: Save the settings.