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

148
Vistas
PayPal button does not capture and onApprove does not return capture function

Everything was working fine but suddenly without changing any code, I noticed that approved orders do not get captured automatically and I have to capture the payment manually using curl.

After some investigations... I found out while using sandbox everything works as intended, I compared the response of live and sandbox modes and I found out that onApprove() actions parameter response in live mode is

{
  order: {},
  payment: null
}

While in sandbox mode is

{
  order: {capture: ƒ, authorize: ƒ, patch: ƒ, get: ƒ}
  payment: null
  redirect: ƒ r()
  restart: ƒ r()
}

So, actions.order.capture() does not exist in live mode, hence does not capture automatically and no onError exceptions were thrown.

My onApprove code

onApprove: function(data, actions) {
  return actions.order.capture().then(function(details) {
    alert('Transaction approved by ' + details.payer.name.given_name);
  });
},

How can I resolve this problem?

about 4 years ago · Juan Pablo Isaza
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