Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

inaccurate payee_name for Sparkasse transactions (fints dumper) #54

Open
yuvke opened this issue Mar 10, 2019 · 2 comments
Open

inaccurate payee_name for Sparkasse transactions (fints dumper) #54

yuvke opened this issue Mar 10, 2019 · 2 comments

Comments

@yuvke
Copy link

yuvke commented Mar 10, 2019

Hi,

It seems that for many transactions I a get a generic payee called Landesbank Hessen-Thuringen.
If I look more closely at the transactions, I can find the actual name of the business in a different position on the source string, so that if I change these rows in fints.rb:

def payee_name(transaction)
  parse_transaction_at(32, transaction).try(:strip)
end

To this:

def payee_name(transaction)
  name = parse_transaction_at(32, transaction).try(:strip)
  return name unless name.include? "Landesbank Hessen-Thuringen"
  parse_transaction_at(22, transaction).try(:strip).split("+").last
end

I get a much nicer output. Did anyone else encounter this? Is there a better way to find out where the payee is located in the source string?

@gitviola
Copy link
Owner

Hi @yuvke can you try the latest master? I merged #53 the other day and it could be that it works with this.

https://github.com/railslove/cmxl/blob/master/lib/cmxl/fields/statement_details.rb#L45-L47

@yuvke
Copy link
Author

yuvke commented Mar 11, 2019

Hey @schurig, it doesn't solve it. But it does simplify the code a bit...
The main issue as I see it is that sometimes the payee is a service like PaySquare or the payment is to Landesbank Hessen-Thuringen even though the actual transaction occurred at one of their clients.
The only problem is I don't know the list of such possible Payments Aggregators (is that even the right name?)...
My current code is something like this:

def isPaymentAggregator?(str)
  aggs = ["Landesbank Hessen-Thuringen", "PaySquare"]
  aggs.select {|agg| str.include? agg }.length > 0
end

def payee_name(transaction)
  name = transaction.name.try(:strip)
  return name unless name !=nil && isPaymentAggregator?(name)
  name = transaction.sub_fields['22'].try { |str| str.split("+").last }
end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants