ibragimoff26 / crypto-pay-api
Crypto pay api for @CryptoBot
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 is a payment system based on @CryptoBot, which allows you to accept payments in cryptocurrency using the API. This library help you to work with Crypto Pay via Crypto Pay API.
Install
composer require ibragimoff26/crypto-pay-api
Usage
Just create an instance of 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"
)
);