To install through composer by using the following command:
composer require php-http/guzzle7-adapter hakimrazalan/chip-php-sdk
Refer PHP-HTTP Clients & Adapters for other supported clients and adapters.
To create CHIP client, you need to know which service you want to use - Collect / Send. Use the following codes:
use Chip\Client;
// To use Collect
$collect = Client::makeCollect("myApiKey");
// To use Send
$collect = Client::makeSend("myApiKey", "secretKey");
Alternatively, you could configure Http\Client\Common\HttpMethodsClient
manually
use Chip\Client;
// To use Collect
$http = Laravie\Codex\Discovery::client();
$collect = Client::makeCollect("myApiKey", $http);
// To use Send
$send = Client::makeSend("myApiKey", "secretKey", $http);
Sandbox options is only supported for Send API. To use sandbox environment:
$send->useSandbox();
For Collect → Here
For Send → Here