rrd108/mnb 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rrd108/mnb

最新稳定版本:1.1.0

Composer 安装命令:

composer require rrd108/mnb

包简介

PHP 8 version of szunisoft/mnb MNB (Magyar Nemzeti Bank) SOAP Client

README 文档

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'}();

统计信息

  • 总下载量: 1.27k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-01-12