gitviola / ynab-bank-importer

💰 Pull transactions from your bank and import them to YNAB automatically.
https://ynab.com/referral/?ref=C-_IP8eD8dWYfEec&utm_source=customer_referral
MIT License
134 stars 20 forks source link

Error with comdirect #30

Closed philipp-paland closed 6 years ago

philipp-paland commented 6 years ago

Hi,

the current version works fine with my Sparkasse account but I can't access my comdirect account. I'm getting this error:

docker-compose run importer
Traceback (most recent call last): 9: from /usr/app/run.rb:9:in <main>' 8: from /usr/app/run.rb:9:inmap' 7: from /usr/app/run.rb:11:in block in <main>' 6: from /usr/app/lib/account.rb:18:infetch_transactions' 5: from /usr/app/lib/dumper/fints.rb:24:in fetch_transactions' 4: from /usr/app/lib/dumper/fints.rb:24:inmap' 3: from /usr/app/lib/dumper/fints.rb:24:in block in fetch_transactions' 2: from /usr/app/lib/dumper.rb:30:into_ynab_transaction' 1: from /usr/app/lib/dumper/fints.rb:68:in import_id' /usr/app/lib/dumper/fints.rb:85:intransaction_type': undefined method `encode' for nil:NilClass (NoMethodError)

This is my config:

gitviola commented 6 years ago

Hey @therealppa, thanks for reporting the issue. Do you mind cloning the repo and applying the following diff to the code?

diff --git i/lib/dumper/fints.rb w/lib/dumper/fints.rb
index 8066c4b..91d62cc 100644
--- i/lib/dumper/fints.rb
+++ w/lib/dumper/fints.rb
@@ -22,6 +22,7 @@ class Dumper
       statement = client.get_statement(account, Date.today - 35, Date.today)

       statement.map { |t| to_ynab_transaction(t) }
+      exit
     end

     private
@@ -35,6 +36,10 @@ class Dumper
     end

     def payee_name(transaction)
+      puts
+      puts '############### +++ below +++ ###################'
+      puts
+      puts transaction.inspect
       parse_transaction_at(32, transaction).try(:strip)
     end

Then you will need to run docker-compose -f docker-compose.dev.yml run ruby.

Please also comment-out all banks in the config.yml except Comdirect, this way we only get the output for that one and not mix it with the one from Sparkasse.

You will then see some output, I need the last one (before the error). It would be cool if you could pseudonymize it so that others don't know your IBAN ect. Alternatively feel free to send it to me via email. That way I can try to reproduce it on my machine and find the issue and maybe even be able to add a more helpful error.

Feel free to leave the transaction's description as it is, that way I can check if I can solve https://github.com/schurig/ynab-bank-importer/issues/31.