Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

186
Views
¿Cómo pasar el ID de pedido al botón de Paypal?

Creo un pedido por mi php sdk.

como esto

 $result = json_decode((string) $response->getBody()); echo $result->id; // id of the created order

y ahora tengo esta identificación de pedido. pero... ¿Cómo pasar ID de pedido a Paypal Button? como esto

 `paypal.Buttons({ // Set up the transaction createOrder: function(data, actions) { //I don't need create order,I have created an order return actions.order.create({ purchase_units: [{ amount: { value: '88.44' } }] }); }, // Finalize the transaction onApprove: function(data, actions) { return actions.order.capture().then(function(orderData) { // Successful capture! For demo purposes: console.log('Capture result', orderData, JSON.stringify(orderData, null, 2)); var transaction = orderData.purchase_units[0].payments.captures[0]; alert('Transaction '+ transaction.status + ': ' + transaction.id + '\n\nSee console for all available details'); // Replace the above to show a success message within this page, eg // 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'); }); } }).render('#paypal-button-container');
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Cree dos rutas en su servidor, una para crear un pedido (y devolver el JSON resultante) y otra que tome una identificación de pedido como parámetro y la capture (y devuelva el resultado JSON).

Ambas rutas deben devolver/salir solo JSON (sin HTML ni texto).

Empareje esas dos rutas con este flujo de aprobación: https://developer.paypal.com/demo/checkout/#/pattern/server

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!