szunisoft / mnb
MNB (Magyar Nemzeti Bank) SOAP Client
Installs: 1 600
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 3
Open Issues: 1
Requires
- php: ^7.1.3
- ext-simplexml: *
- ext-soap: *
Requires (Dev)
- mockery/mockery: 1.1.*
- phpunit/phpunit: ~7.0
This package is auto-updated.
Last update: 2024-12-25 05:01:26 UTC
README
Requirements
This package requires SoapClient and PHP 7.1 or higher.
Note on behavior
MNB Soap client only supports HUF base currency. So the API will return with the well calculated exchange rates based on HUF.
Usage
Initialize
require 'vendor/autoload.php'; $client = new \SzuniSoft\Mnb\Client();
Access list of currencies
Returns with string array. Each element is a currency code.
$currencies = $client->currencies(); // HUF, EUR, ...
Determine currency existence
$client->hasCurrency('EUR'); // true
List of current currency exchange rates
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
Obtain exchange rate for specific currency
The returned value will be an instance of SzuniSoft\Mnb\Model\Currency
$currency = $client->currentExchangeRate('EUR');
SoapClient proxy
Client has proxy method call which will invoke the desired method on the SoapClient directly.
$client->{'AnyMethodYouWishToInvoke'}();