账单器 / BCU
BCU WebServices 的 PHP 适配器
3.0.0
2024-06-05 01:48 UTC
Requires
- php: ^8.2
- ext-soap: *
Requires (Dev)
- phpunit/phpunit: ^11.1
README
BCU WebServices 的 PHP 适配器
这是一个从乌拉圭中央银行 WebService 中获取各种货币官方报价的工具。
使用的 WebServices 是 awsbcucotizaciones 和 awsultimocierre。
WebServices 的官方文档可以在 这里找到。
安装
最佳使用方式是通过 composer 插件。
composer require biller/bcu
使用
安装后,使用 obtenerCotizacion
方法,该方法将返回美元现汇的最后一次收盘价。
也可以通过调用 obtenerUltimoCierre
方法来获取最后一次收盘的日期。
获取报价
// Dólar interbancario para el último día de cierre biller\bcu\Cotizaciones::obtenerCotizacion();
// Dólar interbancario para el 01-ene-2018 biller\bcu\Cotizaciones::obtenerCotizacion('2018-01-01');
// Dólar interbancario para el 01-ene-2018 biller\bcu\Cotizaciones::obtenerCotizacion('2018-01-01', 2225);
第三个参数表示货币组。
组 1:国际市场
组 2:本地报价
组 0:两个组
// Euro para ambos Grupos de Monedas para el 01-ene-2018 biller\bcu\Cotizaciones::obtenerCotizacion('2018-01-01', 1111, 0);
获取最后一次收盘
biller\bcu\Cotizaciones::obtenerUltimoCierre();