Provides a simple way to generate an ABA file which is used by banks to allow for batch transactions.
This was forked from https://github.com/anam-hossain/aba due to an issue with string padding on the lodgement reference. This fork fixes the text to be left justified as opposed to right justified.
- Simple API
- Framework agnostic
- PHP 5.4+
Aba
is available via Composer
$ composer require abwebdevelopers/aba-generator
Although Aba
is framework agnostic, it does support Laravel out of the box and comes with a Service provider and Facade for easy integration.
After you have installed the Aba
, open the config/app.php
file which is included with Laravel and add the following lines.
In the $providers
array add the following service provider.
ABWebDevelopers\AbaGenerator\AbaServiceProvider::class
Add the facade of this package to the $aliases
array.
'Aba' => ABWebDevelopers\AbaGenerator\Facades\Aba::class,
You can now use this facade in place of instantiating the converter yourself in the following examples.
use ABWebDevelopers\AbaGenerator\Aba;
$aba = new Aba();
// Descriptive record or file header
// The header information is included at the top of every ABA file
// and is used to describe your bank details.
$aba->addFileDetails([
'bank_name' => 'CBA', // bank name
'user_name' => 'Your account name', // Account name
'bsb' => '062-111', // bsb with hyphen
'account_number' => '101010101', // account number
'remitter' => 'Name of remitter', // Remitter
'user_number' => '301500', // User Number (as allocated by APCA). The Commonwealth bank default is 301500
'description' => 'Payroll', // description
'process_date' => '270616' // DDMMYY - Date to be processed
]);
// Add a transaction or Detail record
$aba->addTransaction([
'bsb' => '111-111', // bsb with hyphen
'account_number' => '999999999',
'account_name' => 'Jhon doe',
'reference' => 'Payroll number',
'transaction_code' => '53',
'amount' => '250.87'
]);
$abaFileContent = $aba->generate(); // Generate ABA string.
$aba->download();
$transactions = [
[
'bsb' => '111-111', // bsb with hyphen
'account_number' => '999999999',
'account_name' => 'Jhon doe',
'reference' => 'Payroll number',
'transaction_code' => '53',
'amount' => '250.87'
],
[
'bsb' => '222-2222', // bsb with hyphen
'account_number' => '888888888',
'account_name' => 'Foo Bar',
'reference' => 'Rent',
'transaction_code' => '50',
'amount' => '300'
]
];
foreach ($transactions as $transaction) {
$aba->addTransaction($transaction);
}
$aba->generate();
$aba->download("Multiple-transactions");
use Aba;
// Descriptive record or file header
// The header information is included at the top of every ABA file
// and is used to describe your bank details.
Aba::addFileDetails([]);
Aba::addTransaction([]);
Aba::generate();
Aba::download();
Field | Description |
Bank name | Bank name must be 3 characters long and Capitalised. For example: CBA |
BSB | The valid BSB format is XXX-XXX. |
Account number | Account number must be up to 9 digits. |
User name (Descriptive record) | User or preferred name must be letters only and up to 26 characters long. |
Account name (Detail record) | Account name must be BECS characters only and up to 32 characters long. |
User number | User number which is allocated by APCA must be up to 6 digits long. The Commonwealth bank default is 301500. |
Description (Descriptive record) | Description must be up to 12 characters long and letters only. |
Reference (Detail record) | The reference must be BECS characters only and up to 18 characters long. For example: Payroll number. |
Remitter | The remitter must be letters only and up to 16 characters long. |
Code | Transaction Description |
13 | Externally initiated debit items |
50 | Externally initiated credit items with the exception of those bearing Transaction Codes |
51 | Australian Government Security Interest |
52 | Family Allowance |
53 | Pay |
54 | Pension |
55 | Allotment |
56 | Dividend |
57 | Debenture/Note Interest |