problem trying to install the SDK for PHP

Dom83
Contributor
Contributor

Hello

I am following the guide to use PayPal REST API
https://developer.paypal.com/docs/checkout/reference/server-integration/setup-sdk/
but I have a problem installing the SDK for PHP, with this part :

 

//Create a PHP project in your directory, then run the following command to install the PayPal JavaScript SDK.
composer require paypal/paypal-checkout-sdk 1.0.1

 

This is not PHP. What is it ? Where am I supposed to execute it ?

 

I want to install on both my local PHP (EasyPHP) for tests, and of course on my website (hosted on Hostinger).

 

Login to Me Too
3 REPLIES 3

Alberto123456
Contributor
Contributor

Hello,

composer is an additional programm to run on server. Please ask your provider Hostinger. Many Providers do not support it.

I'am on all-inkl.com in Germany. Here I have the same problem. It is not alowed to execute composer for customers.

You can try to install the sdk manually and get it to run with your own autoloader.

I tried it but without success. Some files are missing in the sdk. See my question here:

https://www.paypal-community.com/t5/SDKs/Uncaught-Error-Interface-PayPalHttp-Environment-not-found/m...

There are many questions here without any answer. So I think this is not moderated by paypal here. I will changed to stripe, its looks easyer to implement.

Login to Me Too

Dom83
Contributor
Contributor

"You can try to install the sdk manually and get it to run with your own autoloader."

I am not sure what you mean. I did not even know what Composer was before I tried to install this. I entered the command in Putty, it said it installed successfully, but I do not see any file anywhere, and the button does not display.

My hosting provider support says that the problem comes from Paypal, and Paypal support says that the problem comes from my hosting provider. Hell!

 

The guide is incredibly poorly explained. By the way, there is a php file we have to create on this page

https://developer.paypal.com/docs/checkout/reference/server-integration/setup-sdk/

but we don't call it anywhere in the next php file so I do not understand what to do with it...

https://developer.paypal.com/docs/checkout/reference/server-integration/set-up-transaction/

 

Login to Me Too

Alberto123456
Contributor
Contributor

You will get more information here:

https://github.com/paypal/Checkout-PHP-SDK 

You also need the paypal-library "paypalhttp".

unfortunately this is not provided with the checkout-php-sdk at this github place.

but you will get it if you run composer on your local machine. copy it to your server.

And ... you need php-skills 😉

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.