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

DKB - 'Anzahl Signaturen für diesen Auftrag unzureichend laut UPD oder BPD.' #100

Open
MyUserForGitHub opened this issue Dec 25, 2019 · 9 comments

Comments

@MyUserForGitHub
Copy link

Using python-fints 3.0.0 (thank you for the update!), DKB does not seem to work.
I've tested with my script and with the test script:

  • get_sepa_accounts works
  • get_balance does not work
  • get_transactions does not work

In both cases it returns 'Anzahl Signaturen für diesen Auftrag unzureichend laut UPD oder BPD.'
It stopped working 2-3 weeks ago.

Please find attached the script and a full log of the dialog.

What can I do? Is there something I could test?
Thanks in advance.

fintest.log
fintest.py.txt

@raphaelm
Copy link
Owner

raphaelm commented Jan 2, 2020

@agross I deleted your comment because it is not about DKB and in fact does not sound very similar since a different set of functions works. Feel free to open up a new issue. See also: https://python-fints.readthedocs.io/en/latest/trouble.html

Repository owner deleted a comment from agross Jan 2, 2020
@raphaelm
Copy link
Owner

raphaelm commented Jan 2, 2020

@MyUserForGitHub Is the attached log file from your test script or from ours from the documentation? I'm a little confused since it does not seem to send HKTAN with the commands at all, either the detection of TAN-required commands is broken or you somehow do not really run 3.0.0.

@MyUserForGitHub
Copy link
Author

@raphaelm Thank you for the feedback.
The output is from the script attached, but I've started with your testscript, had the same behaviour and added only a few lines during testing around.
I understand it's best you have the exact output of the testscript. As I have problems logging the full output of the interactive script, please find attached the "tail" of this real testscript output (manual ChipTAN, last 30 days).
To make sure I have 3.0.0 running, I've added a small "print(version)" in client.py, and it seems to really be 3.0.0.

Thanks in advance for your time.
fintest2.log

@Jan-2k
Copy link

Jan-2k commented Feb 7, 2020

I experienced the same behavior while trying to request the balance from a DKB account. Also used the test script from the documentation and have version 3.0.0 running.

@limes007
Copy link

I have the same problem using DKB and the official test script. get_sepa_accounts works, get_balance and get_transactions not. simple_sepa_transfer works also.

@jakubvalenta
Copy link

The problem seems to be that although DKB returns information that TAN is not required to get balance or transactions, the fact is that TAN is required.

This is what DKB returns and what seems incorrect:

fints.formals.TransactionTanRequired(
    transaction = 'HKKAZ',
    tan_required = False,
),

I managed to work around the issue using the following hack:

diff --git a/fints/client.py b/fints/client.py
index 0e8a9c3..bc8dca8 100644
--- a/fints/client.py
+++ b/fints/client.py
@@ -1472,6 +1472,11 @@ class FinTS3PinTanClient(FinTS3Client):
         ):
             return False
         else:
+            if (
+                seg.header.type in FinTSOperations.GET_BALANCE.value
+                or seg.header.type in FinTSOperations.GET_TRANSACTIONS.value
+            ):
+                return True
             hipins = self.bpd.find_segment_first(HIPINS1)
             if not hipins:
                 return False

@TomBraider42
Copy link

Thanks jakubvalenta!
For netbank i have to use only

if seg.header.type in FinTSOperations.GET_TRANSACTIONS.value:
    return True

because "get balance" works without this patch and breaks with it.

@raphaelm
Copy link
Owner

raphaelm commented Jun 7, 2020

Yeah, that's the big problem: There seems to be no way to detect this and applying the hack breaks other banks.

@JayFoxRox
Copy link

JayFoxRox commented Nov 4, 2022

Couldn't there be some list with common hacks / quirks which the user can enable (like quirks = { force_balance_tan: True, force_transactions_tan: True })?
Such tables are common in other software, such as video console emulators to handle niche cases in specific games, browsers to handle GPU driver differences or drivers to handle hardware or firmware bugs.

Either:

  1. The user would have to manually turn them on by passing the quirks to FinTS3PinTanClient or individual actions like get_balance.
  2. Retrieve quirks from a helper function get_quirks(url, blz, [...]) which can be passed to FinTS3PinTanClient.
  3. Automatically call this helper function internally during the connection in the FinTS3PinTanClient constructor (as all necessary context should be present there, unless someone masqueraded the URL behind a proxy).

I don't think there's much hope that the banks will fix their software, and because multiple banks probably share the same underlying server software, it's likely that there's a small set of necessary hacks to support all banks.

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

No branches or pull requests

7 participants