kaurikk / loan-payment-calculator
This package is abandoned and no longer maintained.
No replacement package was suggested.
Loan payment calculation library
0.0.3
2017-04-29 13:19 UTC
Requires
- php: >=7.1
- kaurikk/loan-amount-calculator: >=0.0
- kaurikk/loan-payment-period: >=0.0
Requires (Dev)
- phpunit/phpunit: >=6.0
This package is not auto-updated.
Last update: 2023-04-29 19:19:26 UTC
README
loan-payment-calculator
Library to calculate full loan payments (with dates, periods, principal and interest amounts).
Basic usage
// $paymentAmountCalculator is instance of PaymentAmountCalculatorInterface // $interestAmountCalculator is instance of InterestAmountCalculatorInterface $calculator = new PaymentsCalculator($paymentAmountCalculator, $interestAmountCalculator); $periods = $paymentPeriods; // must be instance of PaymentPeriodsInterface $principal = 2000; $interestRate = 20; $calculationMode = 1; // see PaymentPeriodsInterface for available modes $futureValue = 0; // Expected value after loan end, usually 0 $payments = $calculator->calculatePayments($periods, $principal, $interestRate, $calculationMode, $futureValue);