A PHP wrapper for CoinPayments.net Api. For account instructions visit: online API documentation to learn how to setup your API Keys and get a link to your account API Keys page.
- PHP 5.5 and above
Composer
Run the following command to include this package via Composer
composer require davmixcool/coinpayments
The simplest example is retrieving basic account information.
use Davmixcool\CoinPayments;
/** Scenario: Retrieve basic user account information.**/
try {
$cps_api = new CoinPayments($private_key, $public_key, 'json');
$information = $cps_api->GetBasicInfo();
} catch (Exception $e) {
echo 'Error: ' . $e->getMessage();
exit();
}
// Check for success of API call
if ($cps_api['error'] == 'ok') {
// Prepare output
} else {
// Throw an error if both API calls were not successful
}
See examples here. for detailed scenarios.
This package is maintained by David Oti and you!
This package is licensed under the MIT license.