From 0bc8f91c882afce9ecd4d1bc1e62456840a6b5ea Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Mon, 22 Dec 2025 14:58:51 +0100 Subject: [PATCH] fix: Handle `NeedTanResponse` on CAMT request --- fints/client.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fints/client.py b/fints/client.py index bde901f..1e73582 100644 --- a/fints/client.py +++ b/fints/client.py @@ -538,7 +538,13 @@ def get_transactions(self, account: SEPAAccount, start_date: datetime.date = Non 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)]