changecoins/http-client

There is no license information available for the latest version (1.0.9) of this package.

Changecoins' PHP SDK for merchant REST API

1.0.9 2025-05-09 15:00 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.