elliotsawyer / nzbanks
活跃新西兰银行的数据库,由用户任务维护
1.0.0-rc2
2019-10-25 07:46 UTC
Requires
- guzzlehttp/guzzle: ~6.0
- neilnz/nzbankaccountvalidation: ^0.1.0
- silverstripe/framework: ^4
Suggests
- silverstripe/cms: Allows you to easily edit file permissions in the CMS
This package is auto-updated.
Last update: 2024-09-09 07:30:55 UTC
README
SilverStripe 模块,用于管理活跃新西兰银行的数据库。该模块还维护一个代表新西兰银行账户号码的数据对象,包括这些号码的验证。它还包含在美元和分之间转换的实用函数。
安装
- 将存储库添加到您的 composer.json。这是一个私有存储库,因此 composer 不会在 Packagist 上找到它
composer require elliotsawyer/nzbanks
- 运行
vendor/bin/sake dev/build flush=
- 使用以下命令用银行分支填充数据库:
vendor/bin/sake dev/tasks/download-bank-register-information flush=
。在命令行界面执行此操作,因为它可能会超过 PHP 的默认执行时间。
配置
只能更改下载 URL。这非常不可能,但可能是因为 PaymentsNZ 没有通知就更新了 URL 多次。
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
银行账户将根据 IRD 校验和格式进行验证。有关此验证的更多信息,请参阅此处:https://www.ird.govt.nz/-/media/Project/IR/PDF/2020RWTNRWTSpecificationDocumentv10.pdf(见第 15 页,“银行账户号码验证”)
版权
© 2019 Elliot Sawyer,CryptoPay Limited。版权所有。
支持
喜欢我的工作?如果您觉得这个模块帮到了您解决问题,请考虑给我买杯咖啡或小额捐赠。我接受以下地址的加密货币
- 比特币:12gSxkqVNr9QMLQMMJdWemBaRRNPghmS3p
- 比特币现金:1QETPtssFRM981TGjVg74uUX8kShcA44ni
- 莱特币:LbyhaTESx3uQvwwd9So4sGSpi4tTJLKBdz