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

Comdirect: credit card account is not a SEPA account #73

Open
runiq opened this issue Jun 7, 2019 · 8 comments
Open

Comdirect: credit card account is not a SEPA account #73

runiq opened this issue Jun 7, 2019 · 8 comments

Comments

@runiq
Copy link

runiq commented Jun 7, 2019

Using get_sepa_accounts() with a Comdirect FinTS object does not yield the credit card accounts:

>>> pprint(f.get_sepa_accounts())
[SEPAAccount(iban='XXX', bic='XXX', accountnumber='XXX', subaccount='Girokonto', blz='XXX'),
 SEPAAccount(iban='XXX', bic='XXX', accountnumber='XXX', subaccount='Tagesgeld PLUS', blz='XXX')]

Even though the very same account is listed when I use get_information() on the FinTS object:

>>> pprint(f.get_information())
{'accounts': [{'account_number': 'XXX',
               'bank_identifier': fints.formals.BankIdentifier(country_identifier='280', bank_code='XXX'),
               'currency': 'EUR',
               'customer_id': 'XXX',
               'iban': 'XXX',
               'owner_name': ['XXX'],
               'product_name': 'Girokonto',
               'subaccount_number': 'Girokonto',
               'supported_operations': {<FinTSOperations.GET_TRANSACTIONS_XML: ('HKCAZ',)>: False,
                                        <FinTSOperations.GET_CREDIT_CARD_TRANSACTIONS: ('DKKKU',)>: False,
                                        <FinTSOperations.GET_STATEMENT: ('HKEKA',)>: False,
                                        <FinTSOperations.GET_STATEMENT_PDF: ('HKEKP',)>: False,
                                        <FinTSOperations.GET_HOLDINGS: ('HKWPD',)>: False,
                                        <FinTSOperations.GET_SEPA_ACCOUNTS: ('HKSPA',)>: True,
                                        <FinTSOperations.GET_SCHEDULED_DEBITS_SINGLE: ('HKDBS',)>: False,
                                        <FinTSOperations.GET_SCHEDULED_DEBITS_MULTIPLE: ('HKDMB',)>: False,
                                        <FinTSOperations.GET_STATUS_PROTOCOL: ('HKPRO',)>: False,
                                        <FinTSOperations.SEPA_TRANSFER_SINGLE: ('HKCCS',)>: True,
                                        <FinTSOperations.SEPA_TRANSFER_MULTIPLE: ('HKCCM',)>: True,
                                        <FinTSOperations.SEPA_DEBIT_SINGLE: ('HKDSE',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_MULTIPLE: ('HKDME',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_SINGLE_COR1: ('HKDSC',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_MULTIPLE_COR1: ('HKDMC',)>: False,
                                        <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_CREATE: ('HKDDE',)>: False,
                                        <FinTSOperations.GET_SEPA_STANDING_DEBITS_SINGLE: ('HKDDB',)>: False,
                                        <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_DELETE: ('HKDDL',)>: False,
                                        <FinTSOperations.GET_TRANSACTIONS: ('HKKAZ',)>: True,
                                        <FinTSOperations.GET_BALANCE: ('HKSAL',)>: True},
               'type': None},
              {'account_number': 'XXX',
               'bank_identifier': fints.formals.BankIdentifier(country_identifier='280', bank_code='20041144'),
               'currency': 'EUR',
               'customer_id': 'XXX',
               'iban': 'XXX',
               'owner_name': ['XXX'],
               'product_name': 'Tagesgeld PLUS',
               'subaccount_number': 'Tagesgeld PLUS',
               'supported_operations': {<FinTSOperations.GET_TRANSACTIONS_XML: ('HKCAZ',)>: False,
                                        <FinTSOperations.GET_CREDIT_CARD_TRANSACTIONS: ('DKKKU',)>: False,
                                        <FinTSOperations.GET_STATEMENT: ('HKEKA',)>: False,
                                        <FinTSOperations.GET_STATEMENT_PDF: ('HKEKP',)>: False,
                                        <FinTSOperations.GET_HOLDINGS: ('HKWPD',)>: False,
                                        <FinTSOperations.GET_SEPA_ACCOUNTS: ('HKSPA',)>: True,
                                        <FinTSOperations.GET_SCHEDULED_DEBITS_SINGLE: ('HKDBS',)>: False,
                                        <FinTSOperations.GET_SCHEDULED_DEBITS_MULTIPLE: ('HKDMB',)>: False,
                                        <FinTSOperations.GET_STATUS_PROTOCOL: ('HKPRO',)>: False,
                                        <FinTSOperations.SEPA_TRANSFER_SINGLE: ('HKCCS',)>: True,
                                        <FinTSOperations.SEPA_TRANSFER_MULTIPLE: ('HKCCM',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_SINGLE: ('HKDSE',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_MULTIPLE: ('HKDME',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_SINGLE_COR1: ('HKDSC',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_MULTIPLE_COR1: ('HKDMC',)>: False,
                                        <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_CREATE: ('HKDDE',)>: False,
                                        <FinTSOperations.GET_SEPA_STANDING_DEBITS_SINGLE: ('HKDDB',)>: False,
                                        <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_DELETE: ('HKDDL',)>: False,
                                        <FinTSOperations.GET_TRANSACTIONS: ('HKKAZ',)>: True,
                                        <FinTSOperations.GET_BALANCE: ('HKSAL',)>: True},
               'type': None},
              {'account_number': 'YYYYYY',
               'bank_identifier': fints.formals.BankIdentifier(country_identifier='280', bank_code='20041144'),
               'currency': 'EUR',
               'customer_id': 'XXX',
               'iban': None,
               'owner_name': ['XXX'],
               'product_name': 'Visa Prepaid-Kreditkarte',
               'subaccount_number': 'Visa Prepaid-Kreditkarte',
               'supported_operations': {<FinTSOperations.GET_TRANSACTIONS_XML: ('HKCAZ',)>: False,
                                        <FinTSOperations.GET_CREDIT_CARD_TRANSACTIONS: ('DKKKU',)>: True,
                                        <FinTSOperations.GET_STATEMENT: ('HKEKA',)>: False,
                                        <FinTSOperations.GET_STATEMENT_PDF: ('HKEKP',)>: False,
                                        <FinTSOperations.GET_HOLDINGS: ('HKWPD',)>: False,
                                        <FinTSOperations.GET_SEPA_ACCOUNTS: ('HKSPA',)>: True,
                                        <FinTSOperations.GET_SCHEDULED_DEBITS_SINGLE: ('HKDBS',)>: False,
                                        <FinTSOperations.GET_SCHEDULED_DEBITS_MULTIPLE: ('HKDMB',)>: False,
                                        <FinTSOperations.GET_STATUS_PROTOCOL: ('HKPRO',)>: False,
                                        <FinTSOperations.SEPA_TRANSFER_SINGLE: ('HKCCS',)>: False,
                                        <FinTSOperations.SEPA_TRANSFER_MULTIPLE: ('HKCCM',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_SINGLE: ('HKDSE',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_MULTIPLE: ('HKDME',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_SINGLE_COR1: ('HKDSC',)>: False,
                                        <FinTSOperations.SEPA_DEBIT_MULTIPLE_COR1: ('HKDMC',)>: False,
                                        <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_CREATE: ('HKDDE',)>: False,
                                        <FinTSOperations.GET_SEPA_STANDING_DEBITS_SINGLE: ('HKDDB',)>: False,
                                        <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_DELETE: ('HKDDL',)>: False,
                                        <FinTSOperations.GET_TRANSACTIONS: ('HKKAZ',)>: False,
                                        <FinTSOperations.GET_BALANCE: ('HKSAL',)>: False},
               'type': None}],
 'auth': {XXX},
 'bank': {'name': 'comdirect bank',
          'supported_operations': {<FinTSOperations.GET_TRANSACTIONS_XML: ('HKCAZ',)>: False,
                                   <FinTSOperations.GET_CREDIT_CARD_TRANSACTIONS: ('DKKKU',)>: True,
                                   <FinTSOperations.GET_STATEMENT: ('HKEKA',)>: False,
                                   <FinTSOperations.GET_STATEMENT_PDF: ('HKEKP',)>: False,
                                   <FinTSOperations.GET_HOLDINGS: ('HKWPD',)>: True,
                                   <FinTSOperations.GET_SEPA_ACCOUNTS: ('HKSPA',)>: True,
                                   <FinTSOperations.GET_SCHEDULED_DEBITS_SINGLE: ('HKDBS',)>: False,
                                   <FinTSOperations.GET_SCHEDULED_DEBITS_MULTIPLE: ('HKDMB',)>: False,
                                   <FinTSOperations.GET_STATUS_PROTOCOL: ('HKPRO',)>: False,
                                   <FinTSOperations.SEPA_TRANSFER_SINGLE: ('HKCCS',)>: True,
                                   <FinTSOperations.SEPA_TRANSFER_MULTIPLE: ('HKCCM',)>: True,
                                   <FinTSOperations.SEPA_DEBIT_SINGLE: ('HKDSE',)>: False,
                                   <FinTSOperations.SEPA_DEBIT_MULTIPLE: ('HKDME',)>: False,
                                   <FinTSOperations.SEPA_DEBIT_SINGLE_COR1: ('HKDSC',)>: False,
                                   <FinTSOperations.SEPA_DEBIT_MULTIPLE_COR1: ('HKDMC',)>: False,
                                   <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_CREATE: ('HKDDE',)>: False,
                                   <FinTSOperations.GET_SEPA_STANDING_DEBITS_SINGLE: ('HKDDB',)>: False,
                                   <FinTSOperations.SEPA_STANDING_DEBIT_SINGLE_DELETE: ('HKDDL',)>: False,
                                   <FinTSOperations.GET_TRANSACTIONS: ('HKKAZ',)>: True,
                                   <FinTSOperations.GET_BALANCE: ('HKSAL',)>: True},
          'supported_sepa_formats': ['urn:iso:std:iso:20022:tech:xsd:pain.001.003.03',
                                     'urn:iso:std:iso:20022:tech:xsd:pain.001.003.03.xsd']}}

The third account is the credit card account. Notably, it does not have an IBAN and the account number is also markedly different from the other accounts (it is much longer and seemingly doesn't follow the same numbering scheme the other accounts do).

How can I use f.get_credit_card_transactions() if I don't have the account object? Can I try creating the account object manually somehow?

@runiq
Copy link
Author

runiq commented Jun 7, 2019

I can get transactions if I just use one of the other accounts in the f.get_sepa_accounts() list and provide the credit card number. Closing!

@runiq runiq closed this as completed Jun 7, 2019
@henryk
Copy link
Contributor

henryk commented Jun 8, 2019

@runiq Can you reconfirm that you can get valid credit card transactions with get_credit_card_transactions()? Because I don't have a bank/card combo that supports that, so I just guessed when writing the function.

@runiq
Copy link
Author

runiq commented Jun 9, 2019

Yeah, the return value looks a little iffy:

[fints.segments.statement.DIKKU2(
  header=fints.formals.SegmentHeader('DIKKU', 5, 2, 3),
  _additional_data=[
    'XXX',
    None,
    ['C', '123,45', 'EUR', '20190609', '184152'],
    None,
    None,
    ['XXX', '20190529', '20190531', None, '16,1', 'EUR', 'D', '1,', '16,1', 'EUR', 'D', ' VENDOR STRING BLABLA', None, None, None, None, None, None, None, None, 'J', '119060195450101'],
    ['XXX', '20190515', '20190516', None, '12,75', 'EUR', 'D', '1,', '12,75', 'EUR', 'D', ' VENDOR STRING BLABLA', None, None, None, None, None, None, None, None, 'J', '119051647256401'],
    (…the list goes on…)
    ['XXX', '20170402', '20170403', None, '8,6', 'EUR', 'D', '1,', '8,6', 'EUR', 'D', ' VENDOR STRING BLABLA', None, None, None, None, None, None, None, None, 'J', '117040382318501'],
    ['XXX', '20170312', '20170313', None, '8,6', 'EUR', 'D', '1,', '8,6', 'EUR', 'D', ' VENDOR STRING BLABLA', None, None, None, None, None, None, None, None, 'J', '117031373950101']
  ]
)]

Some notes and observations:

  • XXX is my CC number.
  • The item at index 2 in _additional_fields seems to be my credit card balance at the time indicated (i.e. 123,45 EUR on 2019-06-09 18:41:52).
  • the actual transaction list seems to be starting at index 5, from newest to oldest.
  • for each transaction, the value seems to be at index 5.
  • the last number seems to contain a date in it, but I have no idea what it's supposed to represent.
  • I have no idea what the other fields mean, unfortunately.

I'd be glad to help you improve this function. Can you give me some pointers as to what you'd expect the output to look like?

@runiq runiq reopened this Jun 9, 2019
@henryk
Copy link
Contributor

henryk commented Jun 9, 2019

I now remembered that I do have a test account and credit card with comdirect, just hadn't realized they implement DKKKU2. I'm tracking my work at https://github.com/henryk/python-fints/tree/implement-dikku2

@henryk
Copy link
Contributor

henryk commented Jun 10, 2019

(Note: The correct way to get the list of accounts and available operations is get_information(), we should document that. get_sepa_accounts() was a protocol level kludge for the SEPA change-over, and is now mostly mis-used to get an account inventory, but, as seen here, may have exceptions. The account list in get_information() should always be accurate and definitive.)

@Ulli2k
Copy link

Ulli2k commented Aug 25, 2019

I have the same issue.
I am able to get the transactions of my bank accounts but I do not get it runnnig for my credit card account.
I get the credit card information by get_information. But I do not know how to get the balance, transactions without an "sepa_account object"

Could you give me a hint?

@cewee
Copy link

cewee commented Sep 14, 2019

I have the same problem as @Ulli2k , looking into the model it seems, that everywhere 'SEPAAccounts' are expected and the representation retrieved by e.g. :
accounts = client.get_information()['accounts']

cannot be used to get transactions. I have to create the object manually as:

sepaAc = models.SEPAAccount(iban=account'iban'], bic='xxx', accountnumber=account['account_number'], subaccount=account['subaccount_number'], blz='xx')
which works for Girokonto but again not for the credit card account.

@neustifter
Copy link

I have the very same problem. get_credit_card_transactions throws an exception that the operation is not supported.

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