Callback URL

Reuse the web integration to process the payments.


If you reuse your web integration of Razorpay Checkout inside a web view on Android or iOS, the checkout form may not open. Issues like this are handled in our Android SDK and iOS SDK, with the SDKs being the preferred method of integration.

However, if you want to reuse the web integration for some reason, you can pass the following callback_url along with other checkout options to process the desired payment:

Copyvar options = { ... // existing options callback_url: 'https://your-server/callback_url', redirect: true }

callback_url needs to accept incoming POST requests. For a successful payment, the callback URL will have razorpay_payment_id, razorpay_order_id and razorpay_signature as the request parameters.

For failed payments, the request parameter are explained in the table below:

Parameter

Present

Example Value

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]

Handy Tips
You can set query parameters with callback_url, to map it with entities at your side. For example, following is a valid callback URL: https://your-site.com/callback?cart_id=12345

×

ON THIS PAGE