emyu/nuban
Composer 安装命令:
composer require emyu/nuban
包简介
A PHP/laravel package for validating and generating nigerian nuban account numbers based CBN guidelines 2021
README 文档
README
This is an easy to use PHP package to help businesses to verify and generate NUBAN numbers for any Nigerian financial institution in accordance with the CBN revised standard 2020.
There are two categories of financial institutions, Deposit Money Banks (DMB) with 3 digit bank code, and Other Financial Institutions (OFI) with 5 digit bank code. The account number to validate must be 10 digits, while serial number for account number generation must be 9 digits.
Installation
To install this package, using your terminal interface, go to your project directory by running
'cd ~/your/project/directory'
To confirm present directory, run
'pwd'
Download the package using composer by running
'composer require emyu/nuban'
How to use
There are two use cases for this package. 'Validation' and 'Generation'
Validation
Follow these steps to validate an account number.
Get a valid bank code (DMB or OFI) and an account number you wish to verify belonging to the bank.
Import the Nuban class using the 'use Emyu/Nuban/Nuban'
Call the Nuban class with it's static method as 'Nuban::validate($bankCode, $accountNumber)' to validate your account number.
It returns 'Valid' if account number is correct and belongs to the bank with the code. Returns 'Invalid' otherwise.
use Emyu\Nuban\Nuban; class ExampleClass { public $bankCode = '011'; public $accountNumber = '0000014579'; function exampleFunction($bankCode, $accountNumber){ // validate a Deposit Money Bank account number $status = Nuban::validate($bankCode, $accountNumber); // value of $status = 'Valid' } }
Generation
Follow these steps to generate an account number.
Get a valid bank code (DMB or OFI) and a 9 digit serial number you wish to use as an account number.
Import the Nuban class using the 'use Emyu/Nuban/Nuban'
Call the Nuban class with it's static method as 'Nuban::generate($bankCode, $serialNumber)' to generate a valid account number.
It returns valid account number for the bank with the code if bank code is valid. Throws an error message if otherwise.
use Emyu\Nuban\Nuban; class ExampleClass { public $bankCode = '011'; public $serialNumber = '000001457'; function exampleFunction($bankCode, $serialNumber){ // generate a Deposit Money Bank account number $accountNumber = Nuban::generate($bankCode, $serialNumber); // value of $accountNumber = '0000014579' } }
Incoming features
- Get bank name from a NUBAN number
- Support for more financial institutions
- Ability to input bank alias in place of bank code
- much more
Want to Contribute?
-
Create an issue or
-
Make a fork of this repository
-
Create a new branch on your repository.
-
Make contributions on that branch.
-
Add tests for new features.
-
Commit your changes and Push.
-
Make a pull request to the base branch. VOILA!!
Love this package?
Please star this repo.
Follow me on Twitter for more updates!
emyu/nuban 适用场景与选型建议
emyu/nuban 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14 次下载、GitHub Stars 达 14, 最近一次更新时间为 2021 年 05 月 01 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Nuban」 「nigerian banks」 「central bank of nigeria」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 emyu/nuban 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 emyu/nuban 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 emyu/nuban 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Bank Accounts validator, info and more...
Bankly API Wrapper
PHP Library that provides currency rates and conversions
Unified API for hippy Nigerian payment gateways..Batteries included. Comes with adapters for Paystack and Amplifypay
Iranian banks payment gateways interface
Anypay is a comprehensive PHP,LARAVEL library for handling multiple payment gateway integrations seamlessly.
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 14
- 点击次数: 11
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2021-05-01