PHPackages                             vovke/loan-payments-calculator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. vovke/loan-payments-calculator

ActiveLibrary[Payment Processing](/categories/payments)

vovke/loan-payments-calculator
==============================

PHP library for payment schedule calculations, using various strategies and configurations.

1.0(8y ago)147.0k4[2 issues](https://github.com/Vovke/loan-payments-calculator/issues)MITPHPPHP &gt;=5.6.0

Since Sep 7Pushed 8y ago3 watchersCompare

[ Source](https://github.com/Vovke/loan-payments-calculator)[ Packagist](https://packagist.org/packages/vovke/loan-payments-calculator)[ RSS](/packages/vovke-loan-payments-calculator/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

LoanPaymentsCalculator
======================

[](#loanpaymentscalculator)

[![Build Status](https://camo.githubusercontent.com/11b0de5ba1bffdf90b453713c134d3cd857939f4eb499d4bd30d020c3e5a0bf1/68747470733a2f2f7472617669732d63692e6f72672f566f766b652f6c6f616e2d7061796d656e74732d63616c63756c61746f722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Vovke/loan-payments-calculator) [![Code Coverage](https://camo.githubusercontent.com/0bb069a3397cc824702255b60e662e0dbc5f641f9564130c7814f3e63abf7081/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f566f766b652f6c6f616e2d7061796d656e74732d63616c63756c61746f722f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Vovke/loan-payments-calculator/?branch=master) [![Scrutinizer Code Quality](https://camo.githubusercontent.com/ffaaae41aa8231e935543df8de01a5148699b66110a92b22762403be0cddbe72/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f566f766b652f6c6f616e2d7061796d656e74732d63616c63756c61746f722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/Vovke/loan-payments-calculator/?branch=master)

LoanPaymentsCalculator is a programmer-oriented library for PHP. It is created to provide Loan Payment Schedules for various inputs and strategies. Mainly developed for the short term loans it can be used for any other loan types as well.

Installation
------------

[](#installation)

You may use [Composer](https://getcomposer.org/) to download and install LoanPaymentsCalculator as well as its dependencies.

```
$ composer require vovke/loan-payments-calculator
```

Standards
---------

[](#standards)

All the dates meet `ISO 8601` standard, `Y-m-d` (YYYY-MM-DD)

Components
----------

[](#components)

### DateProvider

[](#dateprovider)

We use it to provide closest date that suits specific rules, for example, `first day of month`, `not bank holiday` and etc.

```
dateProvider = new DateProvider(DateDetermineStrategy, HolidayProvider, shiftToFuture = true)
dateProvider->calculate( startDate )

```

### HolidayProvider

[](#holidayprovider)

an Interface for checking if the specific date is a bank holiday. Used for `period` calculation in `Schedule`.

### Period

[](#period)

`Period` class is used to provide an object representing a time frame where needed, it contains start and end date for the specific period and the amount of days between those.

We use it as a container to describe the Loan period, where `startDate` is the day when Loan will potentially get issued, and endDate is the date of the last repayment, we also use period for each of the Loan's payments and in that case endDate is the date of the payment's repayment.

### Schedule

[](#schedule)

`Schedule` class is used to generate `periods` for the given loan `period`, number of payments and payment frequency.

```
$schedule = new Schedule($startDate, $numberOfPeriods, $dateProvider)

```

### PaymentScheduleCalculator

[](#paymentschedulecalculator)

`PaymentScheduleCalculator` interface is a contract for implementing different ways of payments calculations.

#### EqualPrincipalPaymentScheduleCalculator

[](#equalprincipalpaymentschedulecalculator)

`EqualPrincipalPaymentScheduleCalculator` is the simplest implementation of `PaymentScheduleCalculator` interface, generates payments with equal principal amount.

```
    $startDate = new \DateTime('1984-08-08');
    $principalAmount = 500;
    $numberOfPeriods = 5;
    $dailyInterestRate = 0.000383;
    $dateProvider = new DateProvider(new ExactDayOfMonthStrategy(), new WeekendsProvider(), true);
    $schedule = new Schedule($startDate, $numberOfPeriods, $dateProvider);
    $schedulePeriods = $schedule->generatePeriods();

    $paymentSchedule = new EqualPrincipalPaymentScheduleCalculator($schedulePeriods, $principalAmount, $dailyInterestRate);
    $payments = $paymentSchedule->calculateSchedule();

```

#### AnnuityPaymentScheduleCalculator

[](#annuitypaymentschedulecalculator)

`AnnuityPaymentScheduleCalculator` generates payments with equal payments amount.

```
    ...
    $paymentSchedule = new AnnuityPaymentScheduleCalculator($schedulePeriods, $principalAmount, $dailyInterestRate);
    $payments = $paymentSchedule->calculateSchedule();

```

License
-------

[](#license)

Released under the terms of the [MIT License](LICENSE).

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3223d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3659699?v=4)[Vova Lando](/maintainers/Vovke)[@Vovke](https://github.com/Vovke)

---

Top Contributors

[![Vovke](https://avatars.githubusercontent.com/u/3659699?v=4)](https://github.com/Vovke "Vovke (13 commits)")

---

Tags

calculationsgenerates-paymentsloanloan-paymentspaymentperiodrepaymentschedulecalculatorannuityinterestloan

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/vovke-loan-payments-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/vovke-loan-payments-calculator/health.svg)](https://phpackages.com/packages/vovke-loan-payments-calculator)
```

###  Alternatives

[uruba/financalc

A lightweight, simple and easy PHP library for calculating annuities (e.g., mortgages) according to various input data

303.5k1](/packages/uruba-financalc)[dinkbit/conekta-cashier

Dinkbit Cashier nos da una interface para cobrar subscripciones con Conketa en Laravel.

365.4k](/packages/dinkbit-conekta-cashier)[msilabs/bkash

bKash Payment Gateway API for Laravel Framework.

181.2k](/packages/msilabs-bkash)[binkode/laravel-paystack

A description for laravel-paystack.

112.1k](/packages/binkode-laravel-paystack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
