From 0d0be6ff7343e8ccbc8c343273fb158d7fb73469 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Henryk=20Pl=C3=B6tz?= Date: Mon, 10 Jun 2019 14:09:55 +0200 Subject: [PATCH] Change get_transactions_xml() return value to also include pending transactions --- fints/client.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/fints/client.py b/fints/client.py index 77596b2..f75921e 100644 --- a/fints/client.py +++ b/fints/client.py @@ -524,11 +524,13 @@ class FinTS3Client: end_date: datetime.date = None) -> list: """ Fetches the list of transactions of a bank account in a certain timeframe as camt.052.001.02 XML files. + Returns both booked and pending transactions. :param account: SEPA :param start_date: First day to fetch :param end_date: Last day to fetch - :return: A list of bytestrings containing XML documents + :return: Two lists of bytestrings containing XML documents, possibly empty: first one for booked transactions, + second for pending transactions """ with self._get_dialog() as dialog: @@ -549,10 +551,12 @@ class FinTS3Client: ) logger.info('Fetching done.') - xml_streams = [] + booked_streams = [] + pending_streams = [] for seg in responses: - xml_streams.append(seg.statement_booked) - return xml_streams + booked_streams.extend(seg.statement_booked.camt_statements) + pending_streams.append(seg.statement_pending) + return booked_streams, pending_streams def get_credit_card_transactions(self, account: SEPAAccount, credit_card_number: str, start_date: datetime.date = None, end_date: datetime.date = None): # FIXME Reverse engineered, probably wrong -- 2.39.5