From: Raphael Michel Date: Wed, 11 Sep 2019 15:31:23 +0000 (+0200) Subject: Hack things until fiducia works X-Git-Tag: v3.0.0~2^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03b35b839b152487df6655d374ff253598127a46;p=thirdparty%2Fpython-fints.git Hack things until fiducia works --- diff --git a/fints/client.py b/fints/client.py index 7430e0f..bfef2d6 100644 --- a/fints/client.py +++ b/fints/client.py @@ -458,16 +458,14 @@ class FinTS3Client: touchdown_counter = 1 touchdown = None - while touchdown or touchdown_counter == 1: - seg = segment_factory(touchdown) + def _continue(command_seg, rm): + nonlocal touchdown_counter - rm = dialog.send(seg) - - for resp in rm.response_segments(seg, *args, **kwargs): + for resp in rm.response_segments(command_seg, *args, **kwargs): responses.append(resp) touchdown = None - for response in rm.responses(seg, '3040'): + for response in rm.responses(command_seg, '3040'): touchdown = response.parameters[0] break @@ -475,7 +473,12 @@ class FinTS3Client: logger.info('Fetching more results ({})...'.format(touchdown_counter)) touchdown_counter += 1 + while touchdown: + seg = segment_factory(touchdown) + self._send_with_possible_retry(dialog, seg, _continue) + seg = segment_factory(touchdown) + self._send_with_possible_retry(dialog, seg, _continue) return responses def _find_highest_supported_command(self, *segment_classes, **kwargs): @@ -1151,6 +1154,9 @@ class FinTS3PinTanClient(FinTS3Client): tan_mechanism.description_required == DescriptionRequired.MUST: seg.tan_medium_name = self.selected_tan_medium.tan_medium_name + if tan_process == '4' and tan_mechanism.VERSION >= 6: + seg.segment_type = orig_seg.header.type + if tan_process in ('2', '3'): seg.task_reference = tan_seg.task_reference diff --git a/fints/dialog.py b/fints/dialog.py index 7392771..dd0efb9 100644 --- a/fints/dialog.py +++ b/fints/dialog.py @@ -68,8 +68,10 @@ class FinTSDialog: Language2.DE, self.client.product_name, self.client.product_version - ) + ), ] + if self.client.mode == FinTSClientMode.INTERACTIVE and self.client.get_tan_mechanisms(): + segments.append(self.client._get_tan_segment(segments[0], '4')) for s in extra_segments: segments.append(s)