how to store the init tan request data?
Trying to store the tan response data via tan_data= f.init_tan_response.get_data()
gives
File "/home/markus/.local/lib/python3.8/site-packages/fints/client.py", line 1028, in get_data "segments_bin": SegmentSequence([self.command_seg, self.tan_request]).render_bytes(), File "/home/markus/.local/lib/python3.8/site-packages/fints/types.py", line 222, in render_bytes return FinTS3Serializer().serialize_message(self) File "/home/markus/.local/lib/python3.8/site-packages/fints/parser.py", line 335, in serialize_message result.append(self.serialize_segment(segment)) File "/home/markus/.local/lib/python3.8/site-packages/fints/parser.py", line 344, in serialize_segment for name, field in segment._fields.items(): AttributeError: 'NoneType' object has no attribute '_fields'
How can I store the data and resuming via response= NeedRetryResponse.from_data(tan_data) f.send_tan(response,tan)?
Please post a full, executable code sample that allows to reproduce the issue :)
I have the same problem:
f = FinTS3PinTanClient(
'123456789', # Your bank's BLZ
'myusername', # Your login name
getpass.getpass('PIN:'), # Your banking PIN
'https://hbci-pintan.gad.de/cgi-bin/hbciservlet',
product_id='Your product ID'
)
with f:
data = f.init_tan_response.get_data()
here the error occures
dialog = f.pause_dialog()
clientData = f.deconstruct(True)
f = FinTS3PinTanClient(
'123456789', # Your bank's BLZ
'myusername', # Your login name
getpass.getpass('PIN:'), # Your banking PIN
'https://hbci-pintan.gad.de/cgi-bin/hbciservlet',
product_id='Your product ID',
fromData=clientData
)
with f.resume_dialog(dialog):
init_tan_response = fints.client.NeedRetryResponse.from_data(data)
f.send_tan(init_tan_response, 'tan')
The object init_tan_response looks like this:
<o.__class__.__name__(command_seg=None, tan_request=fints.segments.auth.HITAN6(header=fints.formals.SegmentHeader('HITAN', 6, 6, 5), tan_process='4', task_reference='XXXXX#LPE#', challenge='Bitte geben Sie die photoTan ein', challenge_hhduc=b'\x00\timage/pngXXXXXXXXXX'))>
command_seq is None -> maybe the cause for the serialization problem, because it iterates over all segments without any check, see https://github.com/raphaelm/python-fints/blob/bc1c81e0a42be245c6af24bb0885ce1b2407bd2a/fints/parser.py#L334
see https://github.com/raphaelm/python-fints/pull/128