icetee / mnb-exchange-rate
Minimal SOAP API wrapper for get exchanges rate from MNB
Installs: 8 606
Dependents: 0
Suggesters: 0
Security: 0
Stars: 8
Watchers: 3
Forks: 2
Open Issues: 0
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^6.3
This package is auto-updated.
Last update: 2025-01-27 15:05:43 UTC
README
Load with composer
The simplest solution is to call the package when using a composer. This cli command, install the package.
$ composer require icetee/mnb-exchange-rate
Usage
Create instance:
$exchange_rate = new \Icetee\MNB\ExchangeRate();
Get current exchange entity by currency:
$rate_entity = $exchange_rate->getCurrentExchangeRate('USD');
The properties of RateEntity
:
object(Icetee\MNB\RateEntity)#40 (4) {
["date":protected]=>
string(10) "2018-10-24"
["unit":protected]=>
string(1) "1"
["value":protected]=>
string(9) "282,91000"
["currency":protected]=>
string(3) "USD"
}
Get all current exchange entities:
$rate_entity_collection = $exchange_rate->getExchangeRates();
The properties of RateEntityCollection
:
object(Icetee\MNB\RateEntityCollection)#4 (1) {
["collection":"Icetee\MNB\RateEntityCollection":private]=>
array(34) {
[0]=>
object(Icetee\MNB\RateEntity)#9 (4) {
["date":protected]=>
string(10) "2018-10-24"
["unit":protected]=>
string(1) "1"
["value":protected]=>
string(9) "200,36000"
["currency":protected]=>
string(3) "AUD"
}
...
}
}
Get filtered exchange entities:
$rate_entity_collection = $exchange_rate->getExchangeRates('1992-11-11', '1992-11-13', 'USD,AUD');
Get filtered units:
$units = $exchange_rate->getCurrencyUnits('USD,AUD');
ExchangeRate functions
RateEntity methods
RateEntityCollection methods
Reference
http://www.mnb.hu/arfolyamok
https://www.mnb.hu/letoltes/aktualis-es-a-regebbi-arfolyamok-webszolgaltatasanak-dokumentacioja-1.pdf