Available in🇮🇳 India
Protect your keys and verify every callback. Never expose your key secret on the client. Verify the razorpay_signature on the payment callback and the X-Razorpay-Signature header on every webhook. Reject tampered values.
Scenarios to test your integration
Scenario details
BP-02 · BP-37 — Verify both signatures Before you start: a callback and a stored webhook from a success trigger. How to test: compute HMAC-SHA256(order_id + "|" + razorpay_payment_id, key secret) with the order ID you stored; compare to razorpay_signature. Compute HMAC-SHA256(raw webhook body, webhook secret); compare to X-Razorpay-Signature. Change one character in each and confirm both are rejected.
Expected result: genuine values pass; tampered values are rejected.
Your integration should: use the stored order_id, never one from the callback, and the raw body, never re-serialised JSON.
Common integration gaps to avoid
Simulate failures
Available in test mode
Not available in test mode: none.