CryptoPay\NZBanks\DownloadBankRegisterInformation
Task for downloading the most recent register of active banks from Payments NZ This list is generally updated once a month If the URL changes, it can be set using the Config API
Synopsis
class DownloadBankRegisterInformation
extends BuildTask
{
- // members
- private static string $bank_register_source = "https://www.paymentsnz.co.nz/documents/6/";
- private $bankRegisterSource = NULL;
- // methods
- public void run()
- private string downloadTextFromPaymentsNZ()
- private array getFieldLengthsFromDatabase()
- private void parseBankRegister()
Hierarchy
Extends
- SilverStripe\Dev\BuildTask
Tasks
Line | Task |
---|---|
90+ | Bank branches are rarely, if ever, edited. This task should allow overwrites |
Members
private
-
$bankRegisterSource
Temp variable for storing the text source -
$bank_register_source
This is the URL to the banks register. It is a text file with approximately 3000 records
Methods
private
- downloadTextFromPaymentsNZ() — Download the register of banks from Payments NZ
- getFieldLengthsFromDatabase() — The bank register is a spreadsheet masquerading as a text file.
- parseBankRegister() — Parse the bank register into the local database, using the Bank model This will only add new banks - it does not update existing ones or delete closed ones.
public
- run() — Run the task. This accepts no parameters