progjp / monobank-api
PHP client for Monobank API
0.1.2
2020-11-28 20:37 UTC
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- guzzlehttp/guzzle: ^7.2
Requires (Dev)
- phpstan/phpstan: ^0.11.8
- phpunit/phpunit: ^8.2
- symfony/var-dumper: ^4.3
This package is auto-updated.
Last update: 2025-03-29 00:50:12 UTC
README
MonobankAPI Client
PHP client for MonoBank API services (https://api.monobank.ua/docs/)
- List of monobank currency rates
- Information about the client and the list of his accounts
- Get statements
- Set webhook
Requirements
- PHP >=7.2
- ext-json
- ext-curl
Install
Via Composer
$ composer require progjp/monobank-api
Usage
Create MonobankAPI Client
$client = new Client(); $monobank = new MonobankAPI($client, '<token>');
Get statements
$response = $monobank->call(new StatementRequest((new StatementDTO()) ->setAccount('test') ->setFrom((new \DateTime('first day of this month'))->getTimestamp()) ->setTo((new \DateTime('last day of this month'))->getTimestamp()) ));
Get client info
$response = $monobank->call(new ClientInfoRequest());
Set a webhook
$response = $monobank->call(new WebHookRequest($webHookUrl));
Delete a webhook
$response = $monobank->call(new WebHookRequest(''));
Get currency rates
$client = new Client(); $monobank = new MonobankAPI($client); $response = $monobank->call(new CurrencyRequest());
Testing
Just run:
$ composer test
License
The MIT License (MIT). Please see License File for more information.