Skip to content

phpeso/peso-exchanger-interop

Repository files navigation

Peso and Exchanger Interoperability

Packagist PHP License

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.

About

Interoperability package for Peso and Exchanger (and Swap)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages