python-fints icon indicating copy to clipboard operation
python-fints copied to clipboard

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

Open MyUserForGitHub opened this issue 5 years ago • 9 comments

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

MyUserForGitHub avatar Dec 25 '19 11:12 MyUserForGitHub

@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

raphaelm avatar Jan 02 '20 07:01 raphaelm

@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.

raphaelm avatar Jan 02 '20 07:01 raphaelm

@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

MyUserForGitHub avatar Jan 03 '20 17:01 MyUserForGitHub

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.

Jan-2k avatar Feb 07 '20 06:02 Jan-2k

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.

limes007 avatar Feb 18 '20 21:02 limes007

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

jakubvalenta avatar Mar 27 '20 12:03 jakubvalenta

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.

TomBraider42 avatar May 28 '20 10:05 TomBraider42

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

raphaelm avatar Jun 07 '20 13:06 raphaelm

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.

JayFoxRox avatar Nov 04 '22 11:11 JayFoxRox