planetadeleste/bcu-currency 问题修复 & 功能扩展

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

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

planetadeleste/bcu-currency

最新稳定版本:1.0.3

Composer 安装命令:

composer require planetadeleste/bcu-currency

包简介

Currency API getting from Uruguayan BCU bank

README 文档

README

Currency API from Uruguayan BCU bank

Inspired in biller/bcu package

Installation

composer require planetadeleste/bcu-currency

Usage

The main class PlanetaDelEste\BCUCurrency\Currency has three static methods, currencies(), latest(), rate(). Each one call a different Soap service, based on url https://cotizaciones.bcu.gub.uy/wscotizaciones/servlet/

Get currencies

Get a list of local or global currencies

$obCurrencies = \PlanetaDelEste\BCUCurrency\Currency::currencies();
$obResponse = $obCurrencies->local();

$arItems = $obResponse->getItems();

Methods

Name Params Return Description
get $iGroupID int CurrenciesResponse Results currencies from both markets (local and international)
both CurrenciesResponse Results currencies from both markets (local and international)
global CurrenciesResponse Results currencies from international markets only
local CurrenciesResponse Results currencies from local markets only
getItems array Return an array of items like example bellow

Response

Class \PlanetaDelEste\BCUCurrency\Service\CurrenciesResponse

Methods
Name Params Return Description
getItems array Return an array of ItemRef like example bellow
Properties

\PlanetaDelEste\BCUCurrency\Service\Currencies\ItemRef

Property Value Description
Codigo int Numeric currecy code
Nombre string Name of currency
[
  {
    "Codigo": 501,
    "Nombre": "PESO ARG.BILLETE"
  },
  {
    "Codigo": 1001,
    "Nombre": "REAL BILLETE"
  },
  {
    "Codigo": 2224,
    "Nombre": "DLS. USA CABLE"
  },
  {
    "Codigo": 2225,
    "Nombre": "DLS. USA BILLETE"
  },
  {
    "Codigo": 2230,
    "Nombre": "DLS.PROMED.FONDO"
  },
  {
    "Codigo": 9700,
    "Nombre": "UNIDAD PREVISIONAL"
  },
  {
    "Codigo": 9800,
    "Nombre": "UNIDAD INDEXADA"
  },
  {
    "Codigo": 9900,
    "Nombre": "UNIDAD REAJUSTAB"
  }
]

Get last closed

Returns the date of last rate closed

Methods

Name Params Return Description
get \PlanetaDelEste\BCUCurrency\Service\LatestResponse

Usage

$obLatest = \PlanetaDelEste\BCUCurrency\Currency::latest();
$obResponse = $obLatest->get();

$sDate = $obResponse->getFecha();
print_r($sDate);

Response

Name Params Return Description
getFecha string Get date in Y-m-d format

2021-06-17

Get rate

Get rate data of selected currency and dates

NAMESPACE \PlanetaDelEste\BCUCurrency\Service

CLASS Rate

$obLatest = \PlanetaDelEste\BCUCurrency\Currency::latest()->get();
$obRate = \PlanetaDelEste\BCUCurrency\Currency::rate();
$obLocalResponse = $obRate->local()->from($obLatest->getFecha())->usd()->get();
$obGlobalResponse = $obRate->global()->from($obLatest->getFecha())->usd()->get();


print_r($obLocalResponse->getItems());
print_r($obGlobalResponse->getItems());

Methods

Name Params Return Description
local Rate Get local currencies
global Rate Get international currencies
both Rate Get both currencies
from string Rate Set date from in Y-m-d format
to string Rate Set date to in Y-m-d format
ars bool Rate Set/add Argentine peso currency
brl bool Rate Set/add Brazilian real currency
usd bool Rate Set/add USA Dollar currency
eur bool Rate Set/add EUR currency. Only works with global currencies.
get RateResponse

Response

Return an array of \PlanetaDelEste\BCUCurrency\Service\RateResponse\ItemRef items

Property Value Description
Fecha string Date of current rate (Y-m-d)
Moneda int Currency ID
Nombre string Name of currency
CodigoISO string ISO code
Emisor string Emmiter country
TCC float Low value
TCV float High value
ArbAct float Arbitrage value
FormaArbitrar int Arbitrage format

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-09-11