PHP code example of dnetix / asoban

1. Go to this page and download the library: Download dnetix/asoban 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/ */

    

dnetix / asoban example snippets


$writer = AsobanWriter::create('YOUR_FILE_PATH');

$writer->addHeader([
    'nit' => '9001238182',
    'date' => date('Y-m-d'),
    'bankCode' => 8,
    'accountNumber' => '00849514000',
    'accountType' => AsobanHeader::AC_SAVINGS,
]);

$writer->addBatch([
    'serviceCode' => '1234567890123',
    'batchCode' => 4,
])->addRow([
    'reference' => '123123123',
    'amount' => 100.12,
    'origin' => AsobanRecord::SOURCE_CREDIBANCO,
    'channel' => AsobanRecord::PM_CARD_INTERNET,
    'operationId' => '012345',
    'authCode' => '000000',
    'branch' => '1234567',
])->addRow([
    'reference' => '213124124',
    'amount' => 201,
    'origin' => AsobanRecord::SOURCE_RBM,
    'channel' => AsobanRecord::PM_CARD_INTERNET,
    'operationId' => '12345',
    'authCode' => '090001',
    'branch' => '1234567',
]);

$writer->addBatch([
    'serviceCode' => '123123999',
])->addRow([
    'reference' => '2341234',
    'amount' => 92780,
    'origin' => AsobanRecord::SOURCE_SAVINGS,
    'channel' => AsobanRecord::PM_ATM,
    'operationId' => '012345',
    'authCode' => '000001',
    'branch' => '1234567',
])->addRow([
    'reference' => '23241259',
    'amount' => 821400,
    'origin' => AsobanRecord::SOURCE_BANK,
    'channel' => AsobanRecord::PM_AUTOSERVICE,
    'operationId' => '12345',
    'authCode' => '090002',
    'branch' => '1234567',
]);

// This will write the file with the information
$writer->generate();