peso/moneyphp-exchange

Peso-based Exchange class for Money

Maintainers

Package info

github.com/phpeso/moneyphp-exchange

Homepage

Documentation

pkg:composer/peso/moneyphp-exchange

Statistics

Installs: 2 174

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2026-04-29 18:08 UTC

This package is auto-updated.

Last update: 2026-04-29 19:23:55 UTC


README

Packagist PHP License GitHub Actions Codecov

This is a library that provides an Exchange class for the Money for PHP based on the Peso for PHP.

Installation

composer require peso/moneyphp-exchange

Example

<?php

use Money\Converter;
use Money\Currencies\ISOCurrencies;
use Money\Currency;
use Money\Money;
use Peso\Money\PesoConverter;
use Peso\Money\PesoExchange;
use Peso\Services\EuropeanCentralBankService;

$exchange = new PesoExchange(new EuropeanCentralBankService());
$eur100 = Money::EUR(10000);

$converter = new Converter(new ISOCurrencies(), $exchange);

var_dump($converter->convert($eur100, new Currency('USD'))); // Money::USD(...)

// or

$converter = new PesoConverter(new ISOCurrencies(), $exchange);

var_dump($converter->convert($eur100, new Currency('USD'))); // Money::USD(...)
var_dump($converter->convertOnDate($eur100, new Currency('USD')), '2026-04-29'); // Money::USD(11706)

Documentation

Read the full documentation here: https://phpeso.org/v1.x/integrations/moneyphp-exchange.html

Support

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

License

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