andrew-svirin/cfonb-php

A PHP Parser for CFONB 120 signatures, 240 transfers. Helper for EBICS.

0.1.0 2021-01-29 12:37 UTC

This package is auto-updated.

Last update: 2024-11-09 01:48:19 UTC


README

Build Status Latest Stable Version License

A PHP Parser for CFONB statements (120c), transfers (240c)

Supports CFONB 120 signature and CFONB 240 transactions formats.
Helper for EBICS Client PHP

Installation

$ composer require andrew-svirin/cfonb-php

How to use

<?php

$parser = new \Silarhi\Cfonb\CfonbParser();

//Gets all statements day by day
foreach($parser->read120C('My Content') as $statement) {
  if ($statement->hasOldBalance()) {
    echo sprintf("Old balance : %f\n", $statement->getOldBalance()->getAmount());
  }
  foreach($statement->getOperations() as $operation) {
    //Gets all statement operations
  }
  
  if ($statement->hasNewBalance()) {
    echo sprintf("New balance : %f\n", $statement->getNewBalance()->getAmount());
  }
}
<?php

$parser = new \Silarhi\Cfonb\CfonbParser();

//Gets all statements day by day
foreach($parser->read240C('My Content') as $transfer) {
  if ($transfer->getHeader()) {
    echo sprintf("Header op code : %f\n", $transaction->getHeader()->getOperationCode());
  }
  foreach($transfer->getTransactions() as $transactions) {
    //Gets all statement operations
  }
  
  if ($transaction->getTotal()()) {
    echo sprintf("Total transfer amount : %f\n", $transaction->getTotal()->getTotalAmount());
  }
}