ibragimoff26 / crypto-pay-api
为 @CryptoBot 设计的加密支付 API
1.1.0
2022-06-13 11:04 UTC
Requires
- php: ^8.0
- doctrine/annotations: ^1.13
- phpdocumentor/reflection-docblock: ^5.3
- symfony/http-client: ^6.0
- symfony/property-access: ^6.0
- symfony/property-info: ^6.0
- symfony/serializer: ^6.0
Requires (Dev)
- phpunit/phpunit: ^9
- symfony/var-dumper: ^6.0
README
Crypto Pay 是一个基于 @CryptoBot 的支付系统,允许您通过 API 接受加密货币支付。这个库可以帮助您通过 Crypto Pay API 使用 Crypto Pay。
安装
composer require ibragimoff26/crypto-pay-api
用法
只需创建一个 CryptoPayApi 实例即可。
$httpClient = new \Ibragimoff\CryptoPayApi\Client\HttpClient(
'API_HOST_NAME', // https://pay.crypt.bot/ for mainnet and https://testnet-pay.crypt.bot/ for testnet
'YOUR_API_KEY',
new \Symfony\Component\HttpClient\CurlHttpClient()
);
$api = new \Ibragimoff\CryptoPayApi\CryptoPayApi($httpClient);
$me = $api->getMe();
$balance = $api->getBalance();
$currencies = $api->getCurrencies();
$exchangeRate = $api->getExchangeRate();
$invoices = $api->getInvoices(
new \Ibragimoff\CryptoPayApi\Model\GetInvoices\GetInvoicesRequest(
asset: "TON"
)
);
$newInvoice = $api->createInvoice(
new \Ibragimoff\CryptoPayApi\Model\CreateInvoice\CreateInvoiceRequest(
asset: "TON",
amount: "0.01"
)
);