var options = {... // existing optionscallback_url: 'https://your-server/callback_url',redirect: true}
The script that callback_url
points to should to handle incoming POST
requests.
For a successful payment, the callback URL will have razorpay_payment_id. In addition, razorpay_order_id and razorpay_signature will be returned in the request body, provided your server-side has been integrated with Orders API. Know more about
.Handy Tips
You can set query parameters with callback_url
to map it with entities at your end. For example, following is a valid callback URL: https://your-site.com/callback?cart_id=12345
Parameter | Present? | Example |
---|---|---|
error | Array Always present | |
error [code] | Always present | BAD_REQUEST_ERROR |
error [description] | Always present | Payment failed due to incorrect card number |
error [field] | Present if payment fails due to basic validation error | card [number] |