Peso Framework interoperability package for Exchanger and Swap.
composer require peso/peso-exchanger-interop
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;
Read the full documentation here: https://phpeso.org/v1.x/interop/exchanger.html
Please file issues on our main repo at GitHub: https://github.com/phpeso/peso-exchanger-interop/issues
The library is available as open source under the terms of the MIT License.