The package provides a convenient interface for interacting with the API (v2) for the service CoinsPaid
Use the package manager composer to install coinspaid-api-php
composer require kukulkan-popolvux/coinspaid-api-php
You can use the library immediately after configuration without specifying any additional values.
\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
\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
\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