Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
 public function getLenderInviteCredit()
 {
     return $this->amount->multiply($this->share);
 }