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

267
Vistas
Confused about server-side SDK of PayPal

Currently I'm integrating PayPal payment into my project, but I'm confused about something. Everything works fine and I'm glad to see it is working, but somehow my sixth sense tells me to create a server-side SDK request instead of the current client-side. Here's what I've done so far:

paypal.Buttons({
    style: {
    layout:  'vertical',
    color:   'blue',
    shape:   'rect',
    label:   'pay',
}, createOrder: function(data, actions) {

        return actions.order.create({

            purchase_units: [{

            amount: {
                description: '{{ $setup->plan->name }}',
                value: '{{ $setup->plan->price }}'

            }

            }],
            application_context: {
                shipping_preference: 'NO_SHIPPING'
            }

        });

}, onApprove: function(data, actions) {

    return actions.order.capture().then(function(orderData) {

        alert('successfull payment');

}).render('#paypal-button-container');

and everything works great, but I want to create a server-side intent because I somehow feel it more secure. Can someone explain me how can I easily either check the transaction within this javascript code if it is completed successfully and the user paid the exact price for the goods or create a server-side intent for the payment so I can prevent users from manually edit the price? The documentation is way too difficult to understand for me that's why I asked my question here. My project is on Laravel 8

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

How to do a server integration is covered within Set up standard payments, in the 'Add and modify the code' section, with links to sample code.

Make 2 routes on your server, one for 'Create Order' and one for 'Capture Order', documented here. Both routes should return only JSON data (no HTML or text). Inside the 2nd route, when the capture API is successful you should store its resulting payment details in your database (particularly purchase_units[0].payments.captures[0].id, which is the PayPal transaction ID) and perform any necessary business logic (such as sending confirmation emails or reserving product) immediately before forwarding your return JSON to the frontend caller.

Pair those 2 routes with the frontend approval flow: https://developer.paypal.com/demo/checkout/#/pattern/server

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