Database of active New Zealand banks, maintained with a user task
SilverStripe module for managing a dataset of active New Zealand banks. This also maintains a DataObject of what represents a New Zealand bank account number, including validation of these numbers. It also contains utility functions for converting between dollars and cents.
composer require cryptopay/nzbanks
vendor/bin/sake dev/build flush=
vendor/bin/sake dev/tasks/download-bank-register-information flush=. Do this on the CLI because it will likely exceed PHP's default execution time.
Only the download URL can be changed. This is incredibly unlikely, but possible because PaymentsNZ has updated the URL more than once without notice.
CryptoPay\NZBanks\DownloadBankRegisterInformation: bank_register_source: https://payments.nz/path/to/register
//convert NZ Dollars to cents NZBankAccount::dollars_to_cents(1.234); //1234 //convert NZ cents into dollars NZBankAccount::cents_to_dollars(1234) //12.34 //identity the bank that issued an account. This is based on the first 6 digits and returns a Bank dataobject Bank::identify('12-3141-0000456-001') // ASB Bank, Willis Street (Bank dataobject) //display the account in a "normalised" format described by the IRD NZBankAccount::prettify('1-2-3-4') //0001-0002-00000003-0004 //display the account in a "normalised" format with a different delimiter NZBankAccount::prettify('1-2-3-4', ' ') //0001 0002 00000003 0004 NZBankAccount::prettify('1-2-3-4', '.') //0001.0002.00000003.0004
Bank accounts are validated according to an IRD checksum format. More information on this validation can be found here: https://www.ird.govt.nz/-/media/Project/IR/PDF/2020RWTNRWTSpecificationDocumentv10.pdf (see page 15, "Bank account number validation")
Â© 2019 Elliot Sawyer, CryptoPay Limited. All rights reserved.
Like my work? Consider shouting me a coffee or a small donation if this module helped you solve a problem. I accept cryptocurrency at the following addresses:
Module rating system helping users find modules that are well supported. For more on how the rating system works visit Module standards
Score not correct? Let us know there is a problem