robvankeilegom / firefly-III-paypal-importer

PayPal Data Importer for Firefly III
48 stars 3 forks source link

Google Pay Transactions: Account name is always the same #15

Closed mgundelfinger closed 1 year ago

mgundelfinger commented 1 year ago

Hey I came across another problem.

I noticed that I have a lot of expenses toward one specific store, a bakery, or rather a lot of money spent there. image

This seemed like way more I would have ever spent there, so I looked into it and also realized that I actually don't really ever buy there using PayPal, I usually (easily 95% of the time) use my bank card. Then I looked at the individual purchases and noticed some of them going over 20€ which is way above what I usually spend there, so I compared it to my PayPal account itself and saw those purchases were going to some completely unrelated places, yet they were associated with the bakery for some reason.

Eventually I found out it is every purchase made through Google Pay that gets this bakery associated with it. These purchases look like this in PayPal: image

And like this in FireflyIII: image

My first assumption was that maybe the very first purchase I made through Google Pay was at that bakery, and that turned out to be the case. So it seems every subsequent purchase simply gets the same account associated with it.

Hope this is enough information to go on, if not, let me know what I can do to help. Thanks in advance!

robvankeilegom commented 1 year ago

Hey!

PayPal in Google Wallet are unfortunately only available in the US and Germany. So i can't try it out myself. Since the importer linked them all to the same firefly expense account i'm guessing PayPal does the same. They're probably all going to the same PayPal account.

I'm not sure how the bakery name gets there. Was the bakery already an expense account when you ran the importer for the first time?

The importer tries to create accounts for every account that is returned from PayPal. If Firefly returns an error that the account is already in use, we'll search for the account by name and reuse it.

mgundelfinger commented 1 year ago

Ahh okay that makes sense, at least to some extent. Because the bakery shows up no matter what I do, it was not an expense account before i initially ran it. I even completely reset my Firefly instance to make sure and the bakery showed up just as before. It definitely gets that name from PayPal.

Like I said before, my assumption is that it takes the name of the very first transaction with Google Pay and creates the expense account for it and then all the subsequent transactions are matched with that expense account.

If i can somehow assist you with testing, please let me know what I can do!

robvankeilegom commented 1 year ago

Thanks for resetting, that clears a lot out. I push a single expense account per PayPal id. I assume all your payments with the Google Pay system have the same id in the payer_info in PayPal, otherwise they wouldn't all be connected to the same account in Firefly.

I also assumed that all PayPal payers with the same id would have the same name, but I'm guessing that's where I'm wrong. I made a change in the latest develop image of the docker container where I made the id + name combination unique instead of just the id. Would you care to try it?

Thanks!

mgundelfinger commented 1 year ago

Hi!

Thanks for the quick response and fix.

I was able to test it just now and it works perfectly! Thank you again, really appreciate it!

robvankeilegom commented 1 year ago

Glad i could help! Thanks for the feedback. If released the change in hotfix 0.3.2. It's available in latest now.