Skip to content

Repository files navigation

Peso-based Exchange class for Money

PackagistPHPLicenseGitHub ActionsCodecov

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

<?phpuseMoney\Converter;
useMoney\Currencies\ISOCurrencies;
useMoney\Currency;
useMoney\Money;
usePeso\Money\PesoConverter;
usePeso\Money\PesoExchange;
usePeso\Services\EuropeanCentralBankService;
$exchange = newPesoExchange(newEuropeanCentralBankService());
$eur100 = Money::EUR(10000);
$converter = newConverter(newISOCurrencies(), $exchange);
var_dump($converter->convert($eur100, newCurrency('USD'))); // Money::USD(...)// or$converter = newPesoConverter(newISOCurrencies(), $exchange);
var_dump($converter->convert($eur100, newCurrency('USD'))); // Money::USD(...)var_dump($converter->convertOnDate($eur100, newCurrency('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.

Releases

Packages

Contributors

Languages