apollopayment/php-api
最新稳定版本:0.3.0
Composer 安装命令:
composer require apollopayment/php-api
包简介
关键字:
README 文档
README
This package makes it easy ApolloPayment Api.
Installation
composer require apollopayment/php-api
Use
Go to your personal account https://app.apollopayment.io/api-keys and get api-keys.
Substitute keys in class call:
include_once ('php-api/vendor/autoload.php'); $apolloPaymentApi = new ApolloPayment\Api('__PUBLIC_KEY__', '__PRIVATE_KEY__');
Check signature
You can test your signature within this method.
$checkSignature = false; try { $checkSignature = $apolloPaymentApi->verifySignature(); } catch (ApolloPayment\Exception $err) { echo $err; } echo $checkSignature ? 'Signature correct' : 'Signature incorrect';
Fetch available currencies
Get list of available currencies for depositing/withdrawing
$avalableCurrencies = []; try { $avalableCurrencies = $apolloPaymentApi->getAvailableCurrenciesList(); } catch (ApolloPayment\Exception $err) { echo $err; } foreach ($avalableCurrencies as $coin) { echo sprintf("%s (%s) = %0.2f$\n", $coin['currency'], $coin['alias'], $coin['priceUSD']); if($coin['networks']) { echo "\t networks:\n"; foreach ($coin['networks'] as $network) echo sprintf("\t\t%s (%s)\n", $network['name'], $network['alias']); } }
Get currencies price-rate
Get price rate from one currency to another
$price = $apolloPaymentApi->priceRate('ETH', 'USDT');
Get advanced balances info
Get info about advanced balance by its id
$balance = null; try { $balance = $apolloPaymentApi->account->getAdvancedBalanceInfo($balanceId); } catch (ApolloPayment\Exception $err) { echo $err; } echo sprintf( "[%s] (%s)\n\tAvalable for deposit: %s\n", $balance['advancedBalanceId'], $balance['currency'], implode(', ', $balance['availableCurrenciesForDeposit']) );
Or get list of advanced balances of user
$balances = []; try { $balances = $apolloPaymentApi->account->getAdvancedBalancesList(); } catch (ApolloPayment\Exception $err) { echo $err; } foreach ($balances as $balance) { echo sprintf( "[%s] (%s)\n\tAvalable for deposit: %s\n", $balance['advancedBalanceId'], $balance['currency'], implode(', ', $balance['availableCurrenciesForDeposit']) ); }
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-05-24