glutnix / nz-bank-account-validation
A library that validates New Zealand bank account numbers (BECS numbers) as matching the format, within valid ranges, and contain a valid checksum.
Installs: 56 981
Dependents: 0
Suggesters: 0
Security: 0
Stars: 11
Watchers: 1
Forks: 3
Open Issues: 4
Requires (Dev)
- phpspec/phpspec: ^2.3
This package is not auto-updated.
Last update: 2025-05-10 21:56:29 UTC
README
A PHP library that validates New Zealand bank account numbers (BECS numbers) as matching the format, within valid ranges, and contain a valid checksum.
Licence
MIT
Requirements
- PHP 5.4+
Installation
Using Composer:
composer require glutnix/nz-bank-account-validation
Alternatively, download the contents of this repository into your project and require the class manually, like a caveman.
Usage
$account = new \Glutnix\BankAccountValidator("01-902-0068389-00"); echo $account->isValid() ? "Valid" : "Not Valid";
There are other usable methods on BankAccountValidator, so check the code: check the spec for how they are used. Maybe contribute some documentation?
Contributing
Open an issue to check if your contribution is desirable, or just go right ahead and send a Pull Request against the master branch.
- Code must be PSR-2 compliant; PHP Code Sniffer and editorconfig settings are included for your convenience.
- Passing PHPSpec tests required to cover any new code.
TODO
- Full-featured Documentation
- Optionally use PaymentsNZ Bank Branch Register to validate against currently open banks and branches.