kukulkan-popolvux / coinspaid-api-php
The package provides a convenient interface for interacting with the API (v2) for the service https://coinspaid.com
Requires
- guzzlehttp/guzzle: ^6.5 || ^7.0
This package is auto-updated.
Last update: 2024-04-22 19:12:54 UTC
README
The package provides a convenient interface for interacting with the API (v2) for the service CoinsPaid
Installation
composer
Use the package manager composer to install coinspaid-api-php
composer require kukulkan-popolvux/coinspaid-api-php
Usage
You can use the library immediately after configuration without specifying any additional values.
Example:
\KukulkanPopolvux\CoinspaidApiPhp\Coinspaid::api()->ping()->getBody();
or
\KukulkanPopolvux\CoinspaidApiPhp\Coinspaid::api()->run()->getBody();
The Response object is returned. Calling the
getBody()
method will return the response body
The answer should returnOK
, it works without a secret key and an api key.
This is just a test of the library connection and its interaction with the CoinsPaid service.
documentation
Example:
\KukulkanPopolvux\CoinspaidApiPhp\Coinspaid::api($apiKey, $secretKey, $environment = 'prod')->getListCurrencies()->getBodyObject();
or
\KukulkanPopolvux\CoinspaidApiPhp\Coinspaid::api($apiKey, $secretKey, $environment = 'prod')->getListCurrencies()->getBody(true);
To obtain
$apiKey
and$secretKey
, you must perform the following steps, which are described in the documentation
By default, the development environment is listed as production ($environment = 'prod'
). You can select two valuestest
andprod
getBodyObject()
will return the response body converted to object or you can usegetBody(true)
method with parametertrue
Get a list of all supported currencies.
documentation
Example:
\KukulkanPopolvux\CoinspaidApiPhp\Coinspaid::api($apiKey, $secretKey, $environment = 'prod')->getListCurrencies()->getData();
Returns the
data
value from the request response.
You can pass a parameter to a methodgetData('currency')
that will return a value by the key that you passed as a parameter