PHP

PayPro provides a PHP client that you can use to connect with the PayPro API. The client is opensource and the source code can be found on GitHub.


Installation

The installation of the PHP client goes through Composer or directly through the source code.

Composer

You can install the PayPro client with Composer. Add PayPro to your composer.json file:

1
2
3
4
5
{
  "require": {
    "paypro/paypro-php-v1": "~1.0"
  }
}

Source

You can also download the source and require the files directly in your project. You just have to require the init.php file in the root directory of the project.

1
2
<?
require_once('init.php');

Usage

If you are using Composer make sure you require the autoloader at least once like:

1
2
<?
require('vendor/autoload.php');

Or if you use the source directly.

1
2
<?
require_once('init.php');

You should now be able to create a \PayPro\Client object in your code.

1
2
<?
$client = new \PayPro\Client('API_KEY');

You can now use this client object to create API calls to the PayPro API.


What's next