sharkyenergy
sharkyenergy

Reputation: 4173

PayPal integration in Laravel site

I need to implement PayPal payment in my Laravel site. I was going for the server side integration, in order to save all the data, transactions and know what they actually bought. But turns out that [the older] server-side integration method [that I was looking at] is archived, and not really the preferred method anymore. Instead, they suggest using the smart buttons, with front end integration only.

Questions:

Upvotes: 1

Views: 518

Answers (1)

Preston PHX
Preston PHX

Reputation: 30379

Smart Payment Buttons can be used with or without a server-side component.

Here is the front-end pattern that communicates with a server-side integration: https://developer.paypal.com/demo/checkout/#/pattern/server

Notice the fetches to two '/demo/...' placeholder endpoints, which need to be replaced with actual routes of yours. The first should create a v2/order via API and return the orderID. The second should capture that order after the payer approves it via Smart Payment Buttons.


The answers to your questions re: a serverless (client-side only) pattern are:

  • Nothing
  • Only what you program the JavaScript to tell you and which it actually successfully tells you, or what you read via email or in your PayPal account or app notifications
  • Refund the transaction
  • It's for people who don't want to do the work of implementing server-side routes and API calls.

Upvotes: 1

Related Questions