]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
fix: Handle `NeedTanResponse` on CAMT request (#207)
authorJan Holthuis <holthuis.jan@googlemail.com>
Mon, 5 Jan 2026 11:09:11 +0000 (12:09 +0100)
committerGitHub <noreply@github.com>
Mon, 5 Jan 2026 11:09:11 +0000 (12:09 +0100)
fints/client.py

index bde901f807a1383d624e0c688932652099c30c23..1e7358274b9b275e7ffe9849c69d59e1ead3eab4 100644 (file)
@@ -538,7 +538,13 @@ class FinTS3Client:
                 return self._get_transactions_mt940(dialog, hkkaz, account, start_date, end_date, include_pending)
             except FinTSUnsupportedOperation:
                 hkcaz = self._find_highest_supported_command(HKCAZ1)
-                booked_streams, pending_streams = self._get_transactions_xml(dialog, hkcaz, account, start_date, end_date)
+                response = self._get_transactions_xml(dialog, hkcaz, account, start_date, end_date)
+
+                # If a TAN is required, exit early
+                if isinstance(response, NeedTANResponse):
+                    return response
+
+                booked_streams, pending_streams = response
                 transactions = []
                 for s in booked_streams:
                     transactions += [Transaction(t) for t in camt053_to_dict(s)]