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

1.0.1 2025-07-01 19:37 UTC

This package is auto-updated.

Last update: 2025-09-26 01:58:05 UTC


README

Packagist PHP License GitHub Actions Codecov

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.