daVmixcool/coinpayments

CoinPayments.net Api 的 PHP 封装。

0.8.1 2018-11-23 23:17 UTC

This package is auto-updated.

Last update: 2024-09-24 13:12:35 UTC


README

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 及以上版本

步骤

安装

Composer

运行以下命令以通过 Composer 包含此包

composer require davmixcool/coinpayments

用法

最简单的示例是检索基本账户信息。

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

}

有关详细场景的示例,请参阅此处

维护者

此包由 David Oti 和您维护!

许可证

此包采用 MIT 许可证