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

Support for Visa Card transactions #53

Closed
MartinScharrer opened this issue Feb 8, 2024 · 9 comments · Fixed by #55
Closed

Support for Visa Card transactions #53

MartinScharrer opened this issue Feb 8, 2024 · 9 comments · Fixed by #55
Labels
enhancement New feature or request

Comments

@MartinScharrer
Copy link
Contributor

MartinScharrer commented Feb 8, 2024

Trade Republic now has a Debit Visa Card available which spendings are taken out from the Cash account directly.
However, pytr (as of V0.1.9) does not include this entries in the generated account_transactions.csv file yet.
In addition to the actual spending additional round-up values might be added if the account holder configured it.
Therefore, when importing this file into tools like Portfolio Performance the reported Cash amount is off.

Please adapt the script to also produce these entries.

@MartinScharrer MartinScharrer added the enhancement New feature or request label Feb 8, 2024
@otmezger
Copy link

I also would love to see this. In addition to just the visa transactions, it would be great to get a complete export of the "cash" account, it's basically a normal bank account and exporting it can enable me to import it in my personal finance software (actual budget)

@MartinScharrer
Copy link
Contributor Author

MartinScharrer commented Mar 5, 2024

I now had a look myself and unfortunatly TR seems to not include the VISA card transactions (payments done with card, safeback and round-up ETF buys) in the timeline responses. This is the reason why they are not included by pytr.

I got some success by implementing a timelineTransactions subscription which then appends more timeline_events, but this only gives me some more entries in the events_with_documents.json file like "Round up" and Card Transactions, but not all and some of their PDFs fail to download with API errors. Further investigation is required.

@otmezger
Copy link

otmezger commented Mar 6, 2024

They must have an API. Both TR web app and mobile app show the card transactions, so they must be serving it somehow. I’m not very familiar with websocket, and was unable to find my way around the code.

@MartinScharrer
Copy link
Contributor Author

I analyzed the API now. They seem to have added additional subscriptions (timelineTransactions, timelineDetailV2) which need to be used instead of the old ones (timeline, timelineDetail) which are however still supported but do not include the newer entry types like the card transactions.

I forked the project now (https://github.com/MartinScharrer/pytr) and added handling of the new websocket subscriptions and their handling. Still needs some work in order to get the documents downloaded as the structure changed.

@MartinScharrer
Copy link
Contributor Author

I made the necessary changes (https://github.com/MartinScharrer/pytr/tree/timeline_V2). It works now for me. I will do some further tests and then make a pull request.

@otmezger
Copy link

Let me know if you need another hand testing. thanks!

@marzzzello
Copy link
Collaborator

@otmezger If you can test the PR that would be great. If everything works I can make a new release

@tenjaa
Copy link

tenjaa commented Mar 29, 2024

I gave it a try and observed a few things by comparing both documents with the following commands:

$dir1 = Get-ChildItem -Recurse -path C:\dir1
$dir2 = Get-ChildItem -Recurse -path C:\dir2
Compare-Object -ReferenceObject $dir1 -DifferenceObject $dir2

it works

I got the new saveback documents. I did not try the round up feature yet so I cannot say anything regarding that.

additional general meeting documents

There are two very recent new documents. They should be there and are just missing in the current version it seems.

different order

I have two deletion confirmations of the same security, same day, same minute.
With the current version, the one with the the starting id ac4... gets renamed. With the new version the one with the id 21c... gets renamed. But both documents are present.
For me that would be fine.

error

I get the following error message with the new version

Received error message: '106 E {"errors":[{"errorCode":"NOT_FOUND","errorField":null,"errorMessage":"Could not find resource","meta":{"source":"PLATFORM"}}]}'

Interestingly it does not seem to matter. Looking at the logs, there are no files missing from the security that it was just checking when that error occured.

@MartinScharrer
Copy link
Contributor Author

I got some error with some new documents which do not have the date in the subtitle entry.
Some code needs to be coded more robust to handle this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants