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

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

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

extradevs/mnb

最新稳定版本:v2.0.0

Composer 安装命令:

composer require extradevs/mnb

包简介

MNB (Magyar Nemzeti Bank) SOAP Client

README 文档

README

Requirements

This package requires SoapClient and PHP 8 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 \Extradevs\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 Extradevs\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 Extradevs\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'}();

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-06