From: Henryk Plötz Date: Mon, 10 Jun 2019 12:09:55 +0000 (+0200) Subject: Change get_transactions_xml() return value to also include pending transactions X-Git-Tag: v2.2.0~7^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0d0be6ff7343e8ccbc8c343273fb158d7fb73469;p=thirdparty%2Fpython-fints.git Change get_transactions_xml() return value to also include pending transactions --- 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