python-fints
python-fints copied to clipboard
ING: KeyError '999' in minimal_interactive_cli_bootstrap
Describe the bug When running the function minimal_interactive_cli_bootstrap for the ING, i get the following error: KeyError: '999'. The configuration worked with version 2 of this api, so pin, identifier and so on should be correct.
Bank I tested this with Name of the bank: ING FinTS URL: https://fints.ing.de/fints/
Log output / error message Call stack: File "/BankingController/FinTS/Api.py", line 25, in init minimal_interactive_cli_bootstrap(self.finClient) File "/venv/lib/python3.7/site-packages/fints/utils.py", line 319, in minimal_interactive_cli_bootstrap if client.is_tan_media_required() and not client.selected_tan_medium: File "/venv/lib/python3.7/site-packages/fints/client.py", line 1171, in is_tan_media_required tan_mechanism = self.get_tan_mechanisms()[self.get_current_tan_mechanism()] KeyError: '999'
Can you please help me with this issue? Please let me know when you need additional informations. Thanks, Tobias
Same problem. It seems the HITANS fields are not found properly, as this line in client.py always returns empty:
for seg in self.bpd.find_segments('HITANS', version):
The debug log shows a header with HITANS, so in theory this should work:
fints.segments.message.HNVSD1( # Verschlüsselte Daten, version 1
# ...
fints.segments.auth.HITANS1(
header = fints.formals.SegmentHeader('HITANS', 11, 1, 4), # Segmentkopf
Edit: I think there is a version mismatch Edit 2: There are a lot of segments with the correct type, but the version is wrong for all of them. Not sure how to proceed here without deeper FinTS knowledge. Edit 3: Could it be the same problem as fixed here? https://github.com/nemiah/phpFinTS/pull/253
Works when you don't use with or minimal_interactive_cli_bootstrap for me!
Works when you don't use
withorminimal_interactive_cli_bootstrapfor me!
No success for me. Could you describe how you got it working?
Sure, it's basically this code:
fints_client = FinTS3PinTanClient(
# ...
)
accounts = fints_client.get_sepa_accounts() # or whatever
Please note that my only use case is getting the accounts and transactions. Plus I'm sure this is still something to be fixed with with and minimal_interactive_cli_bootstrap, but that's at least a workaround.
This issue seems to be because ING does not support any TAN mode in FinTS: https://www.ing.de/ueber-uns/wissenswert/psd2/
If I add following check to https://github.com/raphaelm/python-fints/blob/bc1c81e0a42be245c6af24bb0885ce1b2407bd2a/fints/client.py#L1175 it goes one step further:
if not self.get_tan_mechanisms(): return False
But then https://github.com/raphaelm/python-fints/blob/bc1c81e0a42be245c6af24bb0885ce1b2407bd2a/fints/client.py#L1285 failes, obviously because of a standing dialog. Content of response is: fints.formals.Response(code='3920', reference_element=None, text='Zugelassene Ein- und Zwei-Schritt-Verfahren für den Benutzer', parameters=['900']) but self.get_tan_mechanisms() is, as above, empty. If I additionally remove the set tan statement, the code from there works: https://python-fints.readthedocs.io/en/latest/trouble.html
Are there some inconsistent responses by FinTS interface by ING? (maybe @raphaelm can interpret it easily? Do you need further debug output?)
I can also confirm, that it works without with/minimal_interactive... as @bahlo suggested. As we don't need TANs at all... everything should work like that.
@bahlo : I have the same issue, but struggle a bit to get it running. Could you please provide me with a full executable code?