Skip to content

Commit 446ba96

Browse files
authored
fix: Handle NeedTanResponse on CAMT request (#207)
1 parent 785edb3 commit 446ba96

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fints/client.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,13 @@ def get_transactions(self, account: SEPAAccount, start_date: datetime.date = Non
538538
return self._get_transactions_mt940(dialog, hkkaz, account, start_date, end_date, include_pending)
539539
except FinTSUnsupportedOperation:
540540
hkcaz = self._find_highest_supported_command(HKCAZ1)
541-
booked_streams, pending_streams = self._get_transactions_xml(dialog, hkcaz, account, start_date, end_date)
541+
response = self._get_transactions_xml(dialog, hkcaz, account, start_date, end_date)
542+
543+
# If a TAN is required, exit early
544+
if isinstance(response, NeedTANResponse):
545+
return response
546+
547+
booked_streams, pending_streams = response
542548
transactions = []
543549
for s in booked_streams:
544550
transactions += [Transaction(t) for t in camt053_to_dict(s)]

0 commit comments

Comments
 (0)