public function repaymentAmountForLenders() { // TODO use disbursed amount in lenderInterest $totalLendersAmount = $this->loan->getNativeDisbursedAmount()->add($this->lenderInterest()); $ratio = $this->loan->getNativeDisbursedAmount()->divide($totalLendersAmount); $repaymentAmountForLenders = $this->repaymentAmount->subtract($this->installmentServiceFee()); return $repaymentAmountForLenders->multiply($ratio); }
public function calculateTransactionFee(Loan $loan) { return $loan->getNativeDisbursedAmount() * (5 / 100); //TODO. change nativeAmount to USD }