andrew-svirin/cfonb-php

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

1.0.0 2024-12-12 16:20 UTC

This package is auto-updated.

Last update: 2024-12-12 16:32:49 UTC


README

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 ebics-api/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());
  }
}