]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
Change get_transactions_xml() return value to also include pending transactions 79/head
authorHenryk Plötz <henryk@ploetzli.ch>
Mon, 10 Jun 2019 12:09:55 +0000 (14:09 +0200)
committerHenryk Plötz <henryk@ploetzli.ch>
Mon, 10 Jun 2019 12:19:08 +0000 (14:19 +0200)
fints/client.py

index 77596b22495f3ded84b3a794d6d43e4ea653cdd4..f75921e74ea97c0ae6837d50cff86232e95ae3fb 100644 (file)
@@ -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