PHP code example of abwebdevelopers / aba-generator

1. Go to this page and download the library: Download abwebdevelopers/aba-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

abwebdevelopers / aba-generator example snippets


ABWebDevelopers\AbaGenerator\AbaServiceProvider::class

'Aba' => ABWebDevelopers\AbaGenerator\Facades\Aba::class,

use ABWebDevelopers\AbaGenerator\Aba;

$aba = new Aba();

// Descriptive record or file header
// The header information is  => '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 ::addTransaction([]);

Aba::generate();

Aba::download();