api-examples icon indicating copy to clipboard operation
api-examples copied to clipboard

Want: identifier to merge earlier collected unspecified VISA transactions later

Open jchalvorsen opened this issue 7 years ago • 3 comments

Use case: Pulling all transactions. Realize some of them are only reservations, but still want the data in my personal finance sheet. At a later time I want to merge a fresh set of transactions onto the table, where the row text "VISA" and transactionType = "Bekreftet VISA" gets the correct values.

Can this be made possible?

jchalvorsen avatar Jun 20 '18 20:06 jchalvorsen

I guess what you want, is what is talked about here: https://github.com/Sbanken/api-examples/issues/13

A transaction id is pretty much a make or break function for using the transaction api.

silbernagel avatar Jan 20 '19 06:01 silbernagel

For now I get around this by ignoring all transactions starting with

("Varekjøp", "Varekjøp VISA", "VISA", "Straksoverføring")

I then encode the transactions using base64-encoding. I then use this as my ID. It's not a perfect solution, but it works out alright.

def _encode(self) -> str:
    data_str = pickle.dumps(self._data)
    return base64.urlsafe_b64encode(data_str).decode("utf-8")

I then paste this "id" into my sheet (with white/invisible text). When I then grab new transactions, I first decode the content from all the previous transactions (collected from the sheet), and then check them up against the new transactions.

You can see the whole project here. Not everything is up to date, but at least the Python stuff should work.

anbergem avatar Feb 15 '19 08:02 anbergem

My temporary solution is to not pull in any transactions before a week has passed. The transactions seem to have stabilised at that point.

silbernagel avatar Feb 15 '19 10:02 silbernagel