MrD
MrD

Reputation: 2481

How to install paypal merchant SDK

I would like to use Merchant PayPal SDK for processing my transactions. On the following page there is a brief installation about installing the SDK.

On the GITHUB there are two types of available installation, using install.php and using composer. I prefer installation using install.php.

When I download project from github, there are two folders:

lib
samples

Which folder is important, and which folder should I import in my application and how?

On the GITHUB installation procedure is following:

1. Create a composer.json file with the following contents:

 {
        "name": "me/shopping-cart-app",
        "require": {
            "paypal/merchant-sdk-php":"v2.*"
        }
    }

Question: Where should I put this composer file, how to run composer update etc... Is this step required if I use install.php?

2. Install the SDK as a dependency using composer or the install.php script - I prefer second installation using install.php on my webserver? When I run install.php, what will happen?

3. Require vendor/autoload.php OR PPBootStrap.php in your application depending on whether you used composer or the custom installer. - I should use require_once("PPBootStrap.php") if I use install.php.

Upvotes: 1

Views: 1706

Answers (1)

untitled90
untitled90

Reputation: 158

To partially answer your question:

Composer is a dependency manager. This means that it will download libraries your project needs to run for you. By default it downloads dependencies into a folder called vendor.

All you need to do is include vendor/autoload.php in your project. The rest will be taken care of by the autoloader generated by composer. You can use composer update etc to update your project dependencies.

You can find more information by reading this page: https://getcomposer.org/doc/00-intro.md

Upvotes: 2

Related Questions