Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ING: KeyError '999' in minimal_interactive_cli_bootstrap #108

Open
tovolkmar opened this issue Mar 24, 2020 · 7 comments
Open

ING: KeyError '999' in minimal_interactive_cli_bootstrap #108

tovolkmar opened this issue Mar 24, 2020 · 7 comments

Comments

@tovolkmar
Copy link

tovolkmar commented Mar 24, 2020

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

@c64bob
Copy link

c64bob commented Aug 6, 2020

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):

@bahlo
Copy link

bahlo commented Aug 8, 2020

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? nemiah/phpFinTS#253

@bahlo
Copy link

bahlo commented Aug 8, 2020

Works when you don't use with or minimal_interactive_cli_bootstrap for me!

@c64bob
Copy link

c64bob commented Aug 12, 2020

Works when you don't use with or minimal_interactive_cli_bootstrap for me!

No success for me. Could you describe how you got it working?

@bahlo
Copy link

bahlo commented Aug 12, 2020

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.

@tloebhard
Copy link

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

tan_mechanism = self.get_tan_mechanisms()[self.get_current_tan_mechanism()]
it goes one step further:
if not self.get_tan_mechanisms(): return False

But then

self.set_tan_mechanism('999')
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.

tthurnreiter added a commit to tthurnreiter/fints-to-ynab that referenced this issue Feb 20, 2021
@KevinSzr
Copy link

@bahlo : I have the same issue, but struggle a bit to get it running. Could you please provide me with a full executable code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants