fintreen/php-client
最新稳定版本:1.0.3
Composer 安装命令:
composer require fintreen/php-client
包简介
A PHP client for interacting with Fintreen.com API.
README 文档
README
Fintreen.com php client for crypto-payment gateway API
Fintreen.com php client
Explore the docs on apiary »
Report Bug
·
Request Feature
.
>>> Laravel Client <<<
Tested on php 8.0, 8.1, 8.2. Should be also good with php 8.3.
Use composer2 for this
Installation:
composer req fintreen/php-client
Then see example:
Example:
<?php include "vendor/autoload.php"; use Fintreen\FintreenClient; // or you can download and use // include (__DIR__ . DIRECTORY_SEPARATOR . 'FintreenClient.php'); $token = 'yourtokenhere'; $email = 'youremailhere'; $isTestMode = true; $fintreenClient = new FintreenClient($token, $email, $isTestMode, true); $currencies = $fintreenClient->getCurrenciesList(); var_dump($currencies); $orderStatusList = $fintreenClient->getOrderStatusList(); var_dump($orderStatusList); // Calculate 25 eur in USDT and BTC $currencyCodesToCalculate = ['USDT-TRC20', 'USDT-ERC20', 'BTC']; $calculation = $fintreenClient->calculate(25, $currencyCodesToCalculate); var_dump($calculation); // Create order for 26 eur in usdt-trc20 $transactionCreated = $fintreenClient->createTransaction(26, 'USDT-TRC20', FintreenClient::DEFAULT_FIAT_CODE); var_dump($transactionCreated); $checkedTransaction = $fintreenClient->checkTransaction((int)$transactionCreated['data']['id']); var_dump($checkedTransaction); // Filter params for transactions list $filters = []; $filters['statusId'] = 1; // New $filters['isTest'] = (int)$isTestMode; // should be same or will return 404 $filters['perPage'] = 5; // items per page $filters['page'] = 1; $filters['codesFilter'] = implode(',', $currencyCodesToCalculate);// comma seprated codes to filter transaction with // Note that you can use it without filters $transactionsList = $fintreenClient->getTransactionsList($filters); // You can alternatively use $fintreenClient->sendRequest $anotherFilters['statusId'] = 1; // New $notFilteredTransactions = $fintreenClient->sendRequest('transactions', 'GET', $anotherFilters); var_dump(@json_decode($notFilteredTransactions, true));
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-11