peso / peso-exchanger-interop
Interoperability package for Peso and Exchanger (and Swap)
Installs: 12
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/peso/peso-exchanger-interop
Requires
- php: ^8.2
- florianv/exchanger: ^2.8
- peso/core: ^1.1
- psr/simple-cache: ^1 || ^2 || ^3
Requires (Dev)
- florianv/swap: ^4.3
- guzzlehttp/guzzle: ^7.9
- php-http/guzzle7-adapter: ^1.1
- phpunit/phpunit: ^12.2
- psy/psysh: *
- sandfox.dev/code-standard: ^1.2025.05.07
- squizlabs/php_codesniffer: *
- symfony/cache: ^7.3
- vimeo/psalm: ^6.12
Conflicts
- florianv/exchanger: 2.8.2
This package is auto-updated.
Last update: 2025-09-26 01:58:05 UTC
README
Peso Framework interoperability package for Exchanger and Swap.
Installation
composer require peso/peso-exchanger-interop
Example
Peso services in Exchanger:
<?php use Exchanger\Exchanger; use Exchanger\ExchangeRateQueryBuilder; use Peso\Exchanger\Interop\ExchangerService; use Peso\Services\EuropeanCentralBankService; $service = new ExchangerService(new EuropeanCentralBankService()); $exchanger = new Exchanger($service); $query = (new ExchangeRateQueryBuilder('EUR/USD')) ->setDate(new DateTimeImmutable('2025-06-13')) ->build(); $rate = $exchanger->getExchangeRate($query); echo $rate->getValue(), PHP_EOL; // 1.1512
Exchanger services in Peso:
<?php use Exchanger\Service\EuropeanCentralBank; use Peso\Exchanger\Interop\PesoService; use Peso\Peso\CurrencyConverter; $service = new PesoService(new EuropeanCentralBank()); $peso = new CurrencyConverter($service); // 1.1512 echo $peso->getHistoricalConversionRate('EUR', 'USD', '2025-06-13'), PHP_EOL;
Documentation
Read the full documentation here: https://phpeso.org/v1.x/interop/exchanger.html
Support
Please file issues on our main repo at GitHub: https://github.com/phpeso/peso-exchanger-interop/issues
License
The library is available as open source under the terms of the MIT License.