PHPackages                             elliotsawyer/nzbanks - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. elliotsawyer/nzbanks

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

elliotsawyer/nzbanks
====================

Database of active New Zealand banks, maintained with a user task

0.0.1(7y ago)126[3 issues](https://github.com/elliot-sawyer/nzbanks/issues)BSD-3-ClausePHPCI failing

Since Nov 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/elliot-sawyer/nzbanks)[ Packagist](https://packagist.org/packages/elliotsawyer/nzbanks)[ Docs](http://silverstripe.org)[ RSS](/packages/elliotsawyer-nzbanks/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

New Zealand Banks
=================

[](#new-zealand-banks)

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.

Installation
------------

[](#installation)

1. add the repository to your composer.json. This is a private repo, so composer will not find it on packagist
2. `composer require elliotsawyer/nzbanks`
3. Run `vendor/bin/sake dev/build flush=`
4. Populate the database with bank branches: `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.

Configuration
-------------

[](#configuration)

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
```

Usage
-----

[](#usage)

```
    //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:  (see page 15, "Bank account number validation")

Copyright
---------

[](#copyright)

© 2019 Elliot Sawyer, CryptoPay Limited. All rights reserved.

Support
-------

[](#support)

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:

- Bitcoin: 12gSxkqVNr9QMLQMMJdWemBaRRNPghmS3p
- Bitcoin Cash: 1QETPtssFRM981TGjVg74uUX8kShcA44ni
- Litecoin: LbyhaTESx3uQvwwd9So4sGSpi4tTJLKBdz

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance7

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 60% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~175 days

Total

3

Last Release

2390d ago

Major Versions

0.0.1 → 1.0.0-rc12019-08-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/ad627a2d8fe16725eb7c9cdde9f4e92e26bf3fbf4c5baf3b9eebca58c8168941?d=identicon)[0x0000](/maintainers/0x0000)

---

Top Contributors

[![elliot-sawyer](https://avatars.githubusercontent.com/u/354793?v=4)](https://github.com/elliot-sawyer "elliot-sawyer (12 commits)")[![silverstripe-elliot](https://avatars.githubusercontent.com/u/5863816?v=4)](https://github.com/silverstripe-elliot "silverstripe-elliot (8 commits)")

---

Tags

bankingnew-zealandpaymentssilverstripesilverstripeBanknznew zealandlookup

### Embed Badge

![Health badge](/badges/elliotsawyer-nzbanks/health.svg)

```
[![Health](https://phpackages.com/badges/elliotsawyer-nzbanks/health.svg)](https://phpackages.com/packages/elliotsawyer-nzbanks)
```

###  Alternatives

[silverstripe/environmentcheck

Provides an API for building environment tests

35503.8k13](/packages/silverstripe-environmentcheck)[symbiote/silverstripe-addressable

SilverStripe addressable and geocoding module

2985.1k7](/packages/symbiote-silverstripe-addressable)[jonom/silverstripe-share-care

Social media sharing previews and customisation for Silverstripe

2932.7k1](/packages/jonom-silverstripe-share-care)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
