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

274
Views
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 answers
Answer question

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 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!