What is the easiest way to set up payment buttons in PHP? And how do I do it?

NotLeocab
New Community Member

I can't seem to find any working examples for payment buttons in PHP. All of the examples in the button configuration page are in NodeJS, and there's no mention of buttons in the official PHP SDK so I'm assuming it's a lower-level SDK.

 

I only sell three things with fixed prices and all I need is the standard three PayPal/Venmo/cards buttons that are displayed in the checkout integration page. Scratch that; I'll be happy if I can get just one of those to work.

 

Thanks in advance for any help

Login to Me Too
2 REPLIES 2

angelleye
Advisor
Advisor

Even if you're using PHP to make the API calls to PayPal, you still use the JS SDK to display the buttons on the site.

 

You just add the JS SDK to your script, use it and optional parameters to display buttons accordingly, and then you can use your PHP stuff to make the actual CreateOrder, CaptureOrder, and any other API calls you want.

 

Details are covered here:  https://developer.paypal.com/docs/checkout/standard/integrate/

 

 

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

corinthian
Contributor
Contributor

My issue is that the process of dealing with the payment once made is not documented anywhere. Passing parameters through to a completion page and updating a database as causing me no end of problems.

 

To be frank the official documentation is written by experts and the old fashioned example code where you could update with your own informaiton, test and go is sorely lacking. Especially for a php based enviornment which PayPal appear to be trying to kill off.

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.