hakimrazalan / chip-php-sdk
PHP Agnostic to work with CHIP Asia API
1.0
2025-04-05 07:49 UTC
Requires
- json-mapper/json-mapper: ^2.22
- laravie/codex: ^6.2
- laravie/codex-filter: ^2.1
- spatie/ray: ^1.41
- symfony/http-client: ^7.2
Requires (Dev)
- php-http/guzzle7-adapter: ^1.1
README
Installation
Composer
To install through composer by using the following command:
composer require php-http/guzzle7-adapter hakimrazalan/chip-php-sdk
HTTP Adapter
Refer PHP-HTTP Clients & Adapters for other supported clients and adapters.
Get Started
Creating client
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);
Use Sandbox
Sandbox options is only supported for Send API. To use sandbox environment:
$send->useSandbox();
Usages
For Collect → Here
For Send → Here