progjp / nbu-currency-api
Get currency rate from NBU API
v1.0
2020-11-28 20:13 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
README
NBU Currency Client
PHP client for NBU (National bank of Ukraine) API service (https://old.bank.gov.ua/doccatalog/document?id=72819047)
Requirements
- PHP >=7.2
- ext-json
- ext-curl
Install
Via Composer
$ composer require progjp/nbu_currency
Usage
Get All Currency rates
$client = new CurrencyApiClient(); $client->getCurrencyRate();
Get All Currency rates by date
$client = new CurrencyApiClient(); $client->getCurrencyRate(null, new DateTime());
Get Currency rate by date
$client = new CurrencyApiClient(); $client->getCurrencyRate('USD', new DateTime());