raphaelm / python-fints

Pure-python FinTS (formerly known as HBCI) implementation
https://pypi.python.org/pypi/fints
GNU Lesser General Public License v3.0
324 stars 78 forks source link

No connection to "comdirect" account #69

Closed jazzmoe closed 4 years ago

jazzmoe commented 5 years ago

Hey! I am pretty new to Python but it all seems straight forward to use this API. However, it somehow doesn't work. I try to connect to my COMDIRECT account and I used the following code:

import logging
from datetime import date
import getpass
from fints.client import FinTS3PinTanClient

logging.basicConfig(level=logging.DEBUG)
f = FinTS3PinTanClient(
    '20041111',  # Your bank's BLZ
    '123456789',  # Your login name
    getpass.getpass('123456'),  # Your banking PIN
    'https://fints.comdirect.de/fints'
)

accounts = f.get_sepa_accounts()

And I receive the following error message:

Traceback (most recent call last): File "", line 1, in File "C:\Users\Moritz\Anaconda3\lib\site-packages\fints\client.py", line 414, in get_sepa_accounts with self._get_dialog() as dialog: File "C:\Users\Moritz\Anaconda3\lib\site-packages\fints\client.py", line 254, in _get_dialog self._ensure_system_id() File "C:\Users\Moritz\Anaconda3\lib\site-packages\fints\client.py", line 1053, in _ensure_system_id HKSYN3(SynchronizationMode.NEW_SYSTEM_ID), File "C:\Users\Moritz\Anaconda3\lib\site-packages\fints\dialog.py", line 72, in init retval = self.send(*segments, internal_send=True) File "C:\Users\Moritz\Anaconda3\lib\site-packages\fints\dialog.py", line 133, in send self.client.process_response_message(self, response, internal_send=internal_send) File "C:\Users\Moritz\Anaconda3\lib\site-packages\fints\client.py", line 215, in process_response_message self._process_response(dialog, None, response) File "C:\Users\Moritz\Anaconda3\lib\site-packages\fints\client.py", line 1192, in _process_response raise FinTSClientPINError("Error during dialog initialization, PIN wrong?") fints.exceptions.FinTSClientPINError: Error during dialog initialization, PIN wrong?

I double checked all details and tried some other ways of doing described in some issues such as issue #43 and #45 but I could not get it running. Help much appreciated.

Best, Moritz

ideefixdajoka commented 5 years ago

I am also not an expert, but the error message tells you that your PIN is wrong. I think that you wrote your PIN in the getpass() as a string. However if you run the script it should promt and you have to enter your PIN in the console. Therefore take the number out and leave 'PIN' in the getpass('PIN') and run it again.

-Lukas

raphaelm commented 5 years ago

Could also be a problem like in #66. Can you share a debug log? Feel free to remove personal data such as IBANs and login data.

import logging
logging.basicConfig(level=logging.DEBUG)
tmechsner commented 5 years ago

For me it works exactly like that for exactly the same bank. So I'd support Lukas' suggestion.

raphaelm commented 4 years ago

Closing this since the PSD branch is merged, see also here: https://github.com/raphaelm/python-fints/pull/95#issuecomment-568289618