kostikpenzin/credit-calc
Composer 安装命令:
composer require kostikpenzin/credit-calc
包简介
Calculator for calculating the loan repayment schedule using annuity/differentiated repayment methods. You can specify partial early repayment, as well as take into account one-time/periodic commissions. The package is easily expanded with our own algorithms for calculating the repayment schedule.
README 文档
README
Calculation of the loan repayment schedule with the possibility of specifying early repayment payments. Both the annuity repayment order and the differentiated one are supported.
All monetary values in the package are integers and represent the sum with cents.
Installation
Сomposer: composer require kostikpenzin/credit-calc
Using
require __DIR__ . '/../vendor/autoload.php'; use CreditCalc\Calculator; use CreditCalc\CreditParams; use CreditCalc\UnexpectedPayment; use CreditCalc\RepaymentSchedule; $params = new CreditParams(new DateTime('2023-10-31 00:00:00'), 100000000, 990, 12, CreditParams::DURATION_MONTH); $unexpectedPayments = [ new UnexpectedPayment(10000000, new DateTime('2023-12-15 00:00:00'), UnexpectedPayment::LESS_PAYMENT), new UnexpectedPayment(3565411, new DateTime('2023-01-13 00:00:00'), UnexpectedPayment::LESS_LOAN_PERIOD), new UnexpectedPayment(15000000, new DateTime('2023-02-29 00:00:00'), UnexpectedPayment::LESS_LOAN_PERIOD), ]; $calculator = new Calculator; // we consider the repayment schedule with annuity payments // So that there are differentiated payments, we specify Calculator::TYPE_DIFFERENTIAL as the third parameter /** @var RepaymentSchedule $schedule Payment schedule */ $schedule = $calculator->calculate($params, $unexpectedPayments, Calculator::TYPE_ANNUITY); foreach ($schedule as $repayment) { /** @var DateTime $date Date of the next payment period */ $date = $repayment->getDate()->format('d.m.Y'); /** @var int $payment The amount of the next payment */ $payment = $repayment->getPayment(); /** @var int $percents Interest on the next payment */ $percents = $repayment->getPercents(); /** @var int $body The body of the loan for the next payment */ $body = $repayment->getBody(); /** @var int $body Loan balance after payment */ $balance = $repayment->getBalance(); } /** @var int $total Get the amount of all loan payments */ $total = $schedule->calculateTotalPayments(); /** @var int $overpayment Get the amount of overpayment on the loan */ $overpayment = $schedule->calculateOverpayment(); /** @var int $requestedSum Get the loan amount */ $requestedSum = $schedule->getCreditParams()->getRequestedSum(); /** @var string psk The full cost of the loan as a percentage per annum with rounding up to 3 digits */ $psk = $schedule->calculateTotalCost();
kostikpenzin/credit-calc 适用场景与选型建议
kostikpenzin/credit-calc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.48k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2023 年 04 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「credit」 「calculator」 「loan」 「annuity payment」 「differential payment」 「repayment schedule」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 kostikpenzin/credit-calc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 kostikpenzin/credit-calc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 kostikpenzin/credit-calc 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This Extension integrates a credit check and more made by the LEONEX Risk Management Platform into your order process. Extensive configuration and evaluation options is provided in the Platform
Integration with Cielo gateway.
PHP library for payment schedule calculations, using various strategies and configurations.
Validate credit card number, expiration date, cvc
Asaas.com PHP API v3 Wrapper
Adaptaçao Asaas.com PHP API Wrapper para PHP 5.6
统计信息
- 总下载量: 1.48k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 31
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-04-19