Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

169
Vistas
How to Redirect back to my website after transaction ends on Razorpay . Note: if "redirect=true" is passed as an option

Firstly I am using React and NodeJs for this integration.

I know it's possible to redirect back to the website by using location.href in the handler function.

But what if we are using redirect=true as an options.

It's also mentioned that we can pass the callback_url to the options object. This will make razorpay to redirect to this URL after a successful transaction but this is going to be a POST request. So, we cannot give the URL of our website in here.

example:

const options = {
  key: "razorpay_key",
  currency: data.currency,
  amount: data.amount.toString(),
  order_id: data.id,
  handler: function (response) {
    alert(response.razorpay_payment_id);
    alert(response.razorpay_order_id);
    alert(response.razorpay_signature);
  },
  prefill: {
    name,
    email: "abcd@xyz.com",
    contact: "9999999999",
    method: "netbanking",
  },
  redirect: true, // this redirects to the bank page from my website without opening a new window
  callback_url: "not sure what to do with it",
};

Is there any way I can get back to the cart/website page with these parameters in params (razorpay_payment_id, razorpay_order_id, razorpay_signature) after completion of the transaction.

here you can check all the parameters for checkout options: https://razorpay.com/docs/payments/server-integration/nodejs/payment-gateway/build-integration/#checkout-options

Razorpay web checkout docs link: https://razorpay.com/docs/payments/payment-gateway/web-integration/standard/

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

You should have another db which stores all the value for your order.

So, Your callback_url will be -

Api to the database + unique order_id to provide you with details of order.

var options = {
  ... // existing options
  callback_url: 'https://localhost:3000/cart'+order_id,
  redirect: true
}
about 4 years ago · Santiago Trujillo Denunciar

0

Eventually, I found a way to do the same. As I am using SSR, I created a POST route on my server and simply redirected from there to my webpage.

like,

app.post('/verification', asyncHandler((req, res) => {res.redirect(301, `webpage_url?query_param=${req.body.razorpay_payment_id}`}))

so, checkout options object looks like below

const options = {
    ... // existing options
    redirect: true,
    callback_url: "server_address/verification",
};

Hope it helps someone out facing the same issue :)

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda