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

260
Vistas
PayPal Smart Button - How To Edit Redirect Url

I am trying to input a redirect url link in my PayPal smart button generated code and don't know how to do that. I am hoping that I will get help here please.

I want to be able to redirect customers to e.g (https://www.example.com/request/) after a successful payment.

Below is the smart button code from Paypal:

function initPayPalButton() { paypal.Buttons({ style: { shape: 'rect', color: 'gold', layout: 'vertical', label: 'paypal',
},

createOrder: function(data, actions) {
  return actions.order.create({
    purchase_units: [{"description":"Digital Service","amount":{"currency_code":"USD","value":1}}]
  });
},

onApprove: function(data, actions) {
  return actions.order.capture().then(function(orderData) {

    // Full available details
    console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));

    // Show a success message within this page, e.g.
    const element = document.getElementById('paypal-button-container');
    element.innerHTML = '';
    element.innerHTML = '<h3>Thank you for your payment!</h3>';

    // Or go to another URL:  actions.redirect('thank_you.html');

  });
},

onError: function(err) {
  console.log(err);
}
}).render('#paypal-button-container');
}
initPayPalButton();
about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

You need to comment out the first part, and uncomment the second part, like so:

// Show a success message within this page, e.g.
// const element = document.getElementById('paypal-button-container');
// element.innerHTML = '';
// element.innerHTML = '<h3>Thank you for your payment!</h3>';

// Or go to another URL:
actions.redirect('https://www.example.com/thankyou/');
about 4 years ago · Juan Pablo Isaza Denunciar

0

// Or go to another URL: actions.redirect('thank_you.html');

The answer to your question is in the code sample, right here.

about 4 years ago · Juan Pablo Isaza Denunciar

0

function redirect(url){
  window.setTimeout(function(){
      window.location.href = url;
  }, 300);
}
<button onclick="redirect("https://www.google.com")">Redirect</button>
about 4 years ago · Juan Pablo Isaza 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