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

Implement dikku2

Open henryk opened this issue 5 years ago • 4 comments

This implements DKKKU/DIKKU for fetching credit card transactions from f.e. comdirect.

I'm not quite happy with the API yet: The bank response includes additional data (card number and balance) but also a list of transactions for which a touchdown_point may be in use. How do we want to return that? Concatenate the transaction lists and return the other information separately (secondary question: from the first response or from the last response?)? Create a special container object? Just discard the additional information? (Currently the function just returns a list of DIKKU2 objects)

henryk avatar Jun 10 '19 14:06 henryk

Fixes #73

henryk avatar Jun 10 '19 14:06 henryk

Codecov Report

Merging #80 into master will increase coverage by 0.07%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #80      +/-   ##
==========================================
+ Coverage   88.79%   88.87%   +0.07%     
==========================================
  Files          23       23              
  Lines        3035     3056      +21     
==========================================
+ Hits         2695     2716      +21     
  Misses        340      340
Impacted Files Coverage Δ
fints/segments/statement.py 100% <100%> (ø) :arrow_up:
fints/formals.py 98.55% <100%> (+0.04%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 089961c...4e53b41. Read the comment docs.

codecov[bot] avatar Jun 10 '19 14:06 codecov[bot]

A special container object is probably the cleanest solution? I'm not totally sure either, though.

raphaelm avatar Jun 14 '19 12:06 raphaelm

This is a super useful PR, it would be nice to see this eventually included. One suggestion though. My observation is that, in case there are really no transactions, because the card is so new, or the get_credit_card_transactions call is limited to a timeframe in which there were, no transactions, then these placeholder fields:

    _unknown_2 = DataElementField(type='an')
    _unknown_3 = DataElementField(type='an')

are also missing not just the transactions field, so one gets a warning:

fints/parser.py:163: FinTSParserWarning: Ignoring parser error and returning generic object: Required field DIKKU2._unknown_2 was not present. Turn off robust_mode to see Exception.

And then not even, the otherwise available balance field gets parsed, which would be nice to have in many scenarios, like when there were no transactions in the queried period, but the balance is still a relevant value.

So I would suggest to go with:

   _unknown_2 = DataElementField(type='an', required=False)                                                                                                                          
   _unknown_3 = DataElementField(type='an', required=False)

This has been working well for me so far.

Ferenc- avatar Jul 03 '21 22:07 Ferenc-