Skip to content

Commit

Permalink
Restore _touchdown_... attributes before resuming function with touch…
Browse files Browse the repository at this point in the history
…downs

Fixes raphaelm#125
  • Loading branch information
tloebhard authored Feb 15, 2021
1 parent bc1c81e commit a48efc8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions fints/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1261,6 +1261,24 @@ def send_tan(self, challenge: NeedTANResponse, tan: str):
response = dialog.send(tan_seg)

resume_func = getattr(self, challenge.resume_method)

# Restore _touchdown_... attributes
if challenge.resume_method == '_continue_fetch_with_touchdowns' and challenge.command_seg.TYPE == 'HKKAZ':
self._touchdown_args = ['HIKAZ']
self._touchdown_kwargs = {}
self._touchdown_responses = []
self._touchdown_counter = 1
self._touchdown_dialog = dialog
self._touchdown_response_processor = lambda responses: mt940_to_array(
''.join([seg.statement_booked.decode('iso-8859-1') for seg in responses]))
hkkaz = self._find_highest_supported_command(HKKAZ5, HKKAZ6, HKKAZ7)
self._touchdown_segment_factory = lambda touchdown: hkkaz(
account=challenge.command_seg.account,
all_accounts=False,
date_start=challenge.command_seg.date_start,
date_end=challenge.command_seg.date_end,
touchdown_point=touchdown,
)
return resume_func(challenge.command_seg, response)

def _process_response(self, dialog, segment, response):
Expand Down

0 comments on commit a48efc8

Please sign in to comment.