定制 peso/openexchangerates-service 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

peso/openexchangerates-service

最新稳定版本:1.0.2

Composer 安装命令:

composer require peso/openexchangerates-service

包简介

Open Exchange Rates data provider for Peso

README 文档

README

Packagist PHP License GitHub Actions Codecov

This is an exchange data provider for Peso that retrieves data from Open Exchange Rates.

Installation

composer require peso/openexchangerates-service

Install the service with all recommended dependencies:

composer install peso/openexchangerates-service php-http/discovery guzzlehttp/guzzle symfony/cache

Example

<?php

use Peso\Peso\CurrencyConverter;
use Peso\Services\OpenExchangeRatesService;
use Peso\Services\OpenExchangeRatesService\AppType;
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
use Symfony\Component\Cache\Psr16Cache;

require __DIR__ . '/../vendor/autoload.php';

$cache = new Psr16Cache(new FilesystemAdapter(directory: __DIR__ . '/cache'));
$service = new OpenExchangeRatesService('...', AppType::Free, cache: $cache);
$converter = new CurrencyConverter($service);

// 10664.96 as of 2025-06-26
echo $converter->convert('12500', 'USD', 'EUR', 2), PHP_EOL;

Documentation

Read the full documentation here: https://phpeso.org/v1.x/services/openexchangerates.html

Support

Please file issues on our main repo at GitHub: https://github.com/phpeso/openexchangerates-service/issues

License

The library is available as open source under the terms of the MIT License.

统计信息

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

GitHub 信息

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

其他信息

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