ivanhosgood / aba-file-generator
从一系列交易中生成ABA银行交易文件。从simonblee/aba-file-generator分支而来
0.0.8
2018-06-25 14:00 UTC
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: 3.7.*
- squizlabs/php_codesniffer: 1.*
README
备注
simonblee/aba-file-generator提供的ABA格式与以下规范描述不符:https://www.commbank.com.au/content/dam/robohelp/PDFS/commbiz_direct_credit_debit.pdf https://www.cemtexaba.com/aba-format/cemtex-aba-file-format-details https://www.nab.com.au/content/dam/nabconnectcontent/file-formats/NAB%20Connect%20Consolidated%20File%20Format%20Specification_V0.05.pdf
描述记录不包含BSB或账户号。这些字段(2-18)应留空
概述
为澳大利亚银行的批量银行交易生成ABA文件。
许可证
安装
将文件复制到所需位置或通过composer安装
composer require ivanhosgood/aba-file-generator
用法
使用此ABA文件的描述类型信息创建一个生成器对象
use AbaFileGenerator\Model\Transaction; use AbaFileGenerator\Generator\AbaFileGenerator; $generator = new AbaFileGenerator( '123-456', // bsb '12345678', // account number 'CBA', // bank name 'User Name', 'Remitter', '175029', // direct entry id for CBA 'Payroll' // description ); // Set a custom processing date if required $generator->setProcessingDate('tomorrow');
创建一个实现AbaFileGenerator\Model\TransactionInterface
的对象或对象数组。库中提供了一个简单的交易对象,但可能对您的项目来说过于简单
$transaction = new Transaction(); $transaction->setAccountName(...); $transaction->setAccountNumber(...); $transaction->setBsb(...); $transaction->setTransactionCode(...); $transaction->setReference(...); $transaction->setAmount(...);
生成ABA字符串并将其保存到文件中(或您想要的任何其他方式)
$abaString = $generator->generate($transaction); // $transaction could also be an array here file_put_contents('/my/aba/file.aba', $abaString);