This package requires SoapClient and PHP 7.1 or higher.
MNB Soap client only supports HUF base currency. So the API will return with the well calculated exchange rates based on HUF.
require 'vendor/autoload.php';
$client = new \SzuniSoft\Mnb\Client();
Returns with string array. Each element is a currency code.
$currencies = $client->currencies(); // HUF, EUR, ...
$client->hasCurrency('EUR'); // true
Each element of the returned array will be an instance of SzuniSoft\Mnb\Model\Currency
$exchangeRates = $client->currenctExchangeRates($date);
$exchangeRates[0]->getCode(); // EUR
$exchangeRates[0]->getUnit(); // 1
$exchangeRates[0]->getAmount(); // 300
The returned value will be an instance of SzuniSoft\Mnb\Model\Currency
$currency = $client->currentExchangeRate('EUR');
Client has proxy method call which will invoke the desired method on the SoapClient directly.
$client->{'AnyMethodYouWishToInvoke'}();