public function convertFromUSD(Money $money, Currency $currency, ExchangeRate $exchangeRate) { if ($exchangeRate->getCurrency() != $currency) { throw new InvalidCurrencyExchangeException(); } $rate = $exchangeRate->getRate(); $amount = $money->multiply($rate); return Money::create($amount->getAmount(), $currency); }
public function getLenderInviteCredit() { return $this->amount->multiply($this->share); }