execute($getSepaAccounts); if ($getSepaAccounts->needsTan()) { handleStrongAuthentication($getSepaAccounts); // See login.php for the implementation. } $oneAccount = $getSepaAccounts->getAccounts()[0]; $from = new \DateTime('2022-07-15'); $to = new \DateTime(); $getStatement = \Fhp\Action\GetStatementOfAccount::create($oneAccount, $from, $to, false, true); $fints->execute($getStatement); if ($getStatement->needsTan()) { handleStrongAuthentication($getStatement); // See login.php for the implementation. } $soa = $getStatement->getStatement(); foreach ($soa->getStatements() as $statement) { echo $statement->getDate()->format('Y-m-d') . ': Start Saldo: ' . ($statement->getCreditDebit() == \Fhp\Model\StatementOfAccount\Statement::CD_DEBIT ? '-' : '') . $statement->getStartBalance() . PHP_EOL; echo 'Transactions:' . PHP_EOL; echo '=======================================' . PHP_EOL; foreach ($statement->getTransactions() as $transaction) { echo "Booked : " . ($transaction->getBooked() ? "true" : "false") . PHP_EOL; echo 'Amount : ' . ($transaction->getCreditDebit() == \Fhp\Model\StatementOfAccount\Transaction::CD_DEBIT ? '-' : '') . $transaction->getAmount() . PHP_EOL; echo 'Booking text: ' . $transaction->getBookingText() . PHP_EOL; echo 'Name : ' . $transaction->getName() . PHP_EOL; echo 'Description : ' . $transaction->getMainDescription() . PHP_EOL; echo 'EREF : ' . $transaction->getEndToEndID() . PHP_EOL; echo '=======================================' . PHP_EOL . PHP_EOL; } } echo 'Found ' . count($soa->getStatements()) . ' statements.' . PHP_EOL;