https://github.com/fruitware/bnm
Library uses National Bank of Moldova official gate to get currency rate within given date.
https://github.com/fruitware/bnm
Last synced: 4 months ago
JSON representation
Library uses National Bank of Moldova official gate to get currency rate within given date.
- Host: GitHub
- URL: https://github.com/fruitware/bnm
- Owner: Fruitware
- License: mit
- Created: 2014-11-10T16:38:31.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T05:46:20.000Z (over 2 years ago)
- Last Synced: 2025-04-14T20:07:12.837Z (about 1 year ago)
- Language: PHP
- Homepage:
- Size: 21.5 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
##BNM converter
Library uses National Bank of Moldova official gate to get currency rate within given date.
## Installation via Composer
```composer require "fruitware/bnm" : "2.*"```
## Examples
## Basic usage with current date
```php
// init client
$cacheDir = '/tmp/bnm'; // not required
$client = new \Fruitware\Bnm\Client($cacheDir);
// get rates on a specific date
$rates = $client->get(new DateTime());
// exchange 100 USD to MDL
$exchange = $rates->exchange('USD', 100, 'MDL');
// exchange 1000000 MDL to USD
$exchange = $rates->exchange('MDL', 1000000, 'USD');
// exchange 50000 EUR to MDL
$exchange = $rates->exchange('EUR', 50000, 'MDL');
```