changecoins / http-client
Changecoins' PHP SDK for merchant REST API
Installs: 13 722
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.1
- ext-curl: *
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^9.4
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.1
This package is not auto-updated.
Last update: 2025-06-06 15:33:10 UTC
README
Client usage
To initialize http-client you should provide your secretKey
and publicKey
.
If you do not have them, you can connect with us tech@changecoins.io.
To initialize http-client you should provide your secretKey
and publicKey
.
<?php declare(strict_types=1); namespace App; use ChangeCoins\ClientFacade; use ChangeCoins\Factory\RequestConfig; ... $clientFacade = new ClientFacade(new RequestConfig('secretKey', 'publicKey')); $client = $clientFacade->createClient();
Request examples
<?php ... $balanceDto = new BalanceDto(); $balanceDto->setNonce(time()); $result = $client->getBalance($balanceDto)->toArray();
All request examples you can find here.
Validation errors
Please, note, that current API doesn't correspond to all existing RESTFull API requirements. The responses are unusual (not HTTP status codes) when an error occurs as a result of validation. Response HTTP status code will be 200 and the response body:
{ "err_code": 102, "err_description": "error description" }
If the server will return a validation error, the client will throw ResponseValidationException
.
This type of exception extends \RuntimeException
class
You can find out how does our API works here.