litegoio/litego-php
Composer 安装命令:
composer require litegoio/litego-php
包简介
Litego.io API PHP Class
README 文档
README
Simple Litego API wrapper class, in PHP. Litego API documentation can be found here https://litego.io/documentation/
Installation
Preferred way to install is with Composer as external websocket client library is used.
Just add
"require": {
"litegoio/litego-php": "1.1.*"
}
in your projects composer.json.
Examples
Start by use-ing the class and creating an instance with test/live mode
require('vendor/autoload.php'); use Litego\Litego; $litego = new Litego();
If you want to use test mode
$litego = new Litego('test');
After registration on https://litego.io and getting secret key and merchant ID values try to authenticate (get auth token for other requests) Two ways how to get auth token:
- secret key and merchant ID
- refresh token (if exists).
$result = $litego->authenticate($merchantId, $secretKey);
or
$result = $litego->reauthenticate($refreshToken $merchantId, $secretKey);
You will get auth token and refresh token values. Auth token will be used then for other API requests. Refresh token should be saved for reauthentication when auth token is expired.
Create charge
$result = $litego->createCharge($authToken, $description, $amount_satoshi); print_r($result);
Charges list
$result = $litego->chargesList($authToken, array( 'page' => 1, 'pageSize' => 5, 'paidOnly' => true, )); print_r($result);
Get charge
$result = $litego->getCharge($authToken, $chargeId); print_r($result);
统计信息
- 总下载量: 19
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-06