kouinkouin / php-coda-parser
PHP parser for Belgian CODA banking files
Installs: 2 945
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 27
pkg:composer/kouinkouin/php-coda-parser
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: 4.5.*
This package is not auto-updated.
Last update: 2025-10-24 14:59:18 UTC
README
PHP parser for Belgian CODA banking files
Installation
You can install Codelicious/Coda using Composer. You can read more about Composer and its main repository at
http://packagist.org. First install Composer for your project using the instructions on the
Packagist home page, then define your dependency on Codelicious/Coda in your composer.json file.
{
"require": {
"codelicious/php-coda-parser": "^1.0"
}
}
Or you can execute the following command in your project root to install this library:
composer require codelicious/php-coda-parser:^1.0
Demo / API
You can try the parser at https://eenvoudigfactureren.be/coda. An open API is also available at the same page if you don't feel like hosting the code yourself.
Usage
<?php use Codelicious\Coda\Parser; $parser = new Parser(); $statements = $parser->parseFile('coda-file.cod', 'simple'); foreach ($statements as $statement) { echo $statement->date . "\n"; foreach ($statement->transactions as $transaction) { echo $transaction->account->name . ": " . $transaction->amount . "\n"; } echo $statement->new_balance . "\n"; }
Statement structure
There are 2 structures available. 'raw' which resembles the original file structure and contains all information and 'simple' which is a simplified version only containing the most important information.
If you are unsure what to use you should use 'simple'.
Properties that are not supplied will be null.
Codelicious\Coda\Data\Simple\StatementdateDate of the supplied file (format YYYY-MM-DD)accountAccount for which the statements were created. An object implementingCodelicious\Coda\Data\Simple\Accountoriginal_balanceBalance of the account before the transactions were processed. Up to 3 decimals.new_balanceBalance of the account after the transactions were processed. Up to 3 decimals.free_messagesA list of text messages containing additional informationtransactionA list of transactions implemented asCodelicious\Coda\Data\Simple\Transaction
Codelicious\Coda\Data\Simple\AccountnameName of the holder of the accountbicBankcode of the accountcompany_idOfficial Belgian company number of the account holdernumberBanknumber of the accountcurrencyCurrency of the accountcountryCountry of the account
Codelicious\Coda\Data\Simple\TransactionaccountAccount of the other party of the transaction. An object implementingCodelicious\Coda\Data\Simple\Accounttransaction_dateDate on which the transaction was requestedvaluta_dateDate on which the transaction was executed by the bankamountAmount of the transaction. Up to 3 decimals. A negative number for credit transactions.messageMessage of the transactionstructured_messageStructured messages of the transaction (if available)