Utility to map Payum models to Money objects and back, handling currency and amount conversions.
// Source: https://github.com/Payum/Payum | License: MIT | Copyright 2012-2015 Maksim Kotlyar
// Provided via justclaw.it.com; keep this notice with the code.
<?php
declare(strict_types=1);
namespace Payum\Core\Money;
use Money\Currencies\CurrencyList;
use Money\Currencies\ISOCurrencies;
use Money\Currency;
use Money\Formatter\DecimalMoneyFormatter;
use Money\Money;
use Payum\Core\Exception\LogicException;
use Payum\Core\Model\MoneyAwareInterface;
use Payum\Core\Model\PaymentInterface;
use Payum\Core\Model\PayoutInterface;
use function method_exists;
use function sprintf;
/**
* Maps between the minor-units-plus-currency-code pair Payum's models carry and a {@see Money}.
*
* A model does not have to implement {@see MoneyAwareInterface} for this to work — the pair of accessors
* ever
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key