定制 artemind/credit-calculator 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

artemind/credit-calculator

最新稳定版本:v1.0.0

Composer 安装命令:

composer require artemind/credit-calculator

包简介

A simple PHP-based Credit Calculator that supports multiple types of loan payment calculations

README 文档

README

A simple PHP-based Credit Calculator that supports three types of loan payment calculations:

  • Annuity Payments
  • Differentiated Payments
  • Bullet Payments

Features

  • Annuity Calculation: Fixed monthly payments throughout the loan period.
  • Differentiated Calculation: Payments decrease over time, starting with higher amounts.
  • Bullet Calculation: Payment method where the borrower only pays interest throughout the loan term, and the entire principal is paid in lump sum at the end of loan period.

Requirements

  • PHP 8.2 or higher

Installation

composer require artemind/credit-calculator

Usage

use Artemind\CreditCalculator\ResolverFactory;
use Artemind\CreditCalculator\Enums\CalculationType;

$resolver = ResolverFactory::createResolver(CalculationType::annuity);

$paymentSchedule = $resolver->resolve(6, 5000, 45);

Result

{
   "total_amount_with_interest":5676,
   "total_amount_without_interest":5000,
   "schedule":[
      {
         "month":1,
         "principal_payment":759,
         "interest_payment":188,
         "total_payment":946,
         "remaining_principal":4241
      },
      {
         "month":2,
         "principal_payment":787,
         "interest_payment":159,
         "total_payment":946,
         "remaining_principal":3454
      },
      {
         "month":3,
         "principal_payment":817,
         "interest_payment":130,
         "total_payment":946,
         "remaining_principal":2638
      },
      {
         "month":4,
         "principal_payment":847,
         "interest_payment":99,
         "total_payment":946,
         "remaining_principal":1791
      },
      {
         "month":5,
         "principal_payment":879,
         "interest_payment":67,
         "total_payment":946,
         "remaining_principal":912
      },
      {
         "month":6,
         "principal_payment":912,
         "interest_payment":34,
         "total_payment":946,
         "remaining_principal":0
      }
   ]
}

👨‍💻 Author

Artem Yeremenko

统计信息

  • 总下载量: 0
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-08-04