plaid / pattern

An example end-to-end Plaid integration to create items and fetch transaction data
MIT License
434 stars 216 forks source link

transactions seem inverted. #220

Closed johndpope closed 2 years ago

johndpope commented 2 years ago

I raised an internal case - https://dashboard.plaid.com/support/case/398248 I'm seeing transactions flipped around when viewing them.

Here - $52.51 is represented as positive

Screen Shot 2022-02-23 at 11 46 08 am Screen Shot 2022-02-23 at 11 46 01 am

is there a simple fix? Perhaps just times * -1 ?

Tarious1 commented 2 years ago

Can I see the complete page? All is not showing and why are their negative amounts image

johndpope commented 2 years ago

I attached complete page in the support ticket. Those are someones' personal transactions. I've been using pattern for ages - and used to it being how it is. But apparently - the transactions on other platforms / repos are inverted. I plugged in my secret / ids here - and they appear correctly in negative format. https://github.com/cmenon12/bank-account-to-sheets the complete page is

Screen Shot 2022-02-23 at 4 05 34 pm

but even if I look a single transaction in database - it's reflecting the above + positive value as opposed to the "correct" negative value. If you have access to backend - you could possibly confirm with these transaction ids (all being positive)

Screen Shot 2022-02-23 at 4 08 05 pm
johndpope commented 2 years ago

this is kinda workaround multiplication https://github.com/johndpope/fin/blob/master/backend_go/routes/transactions/transactions.go#L142

I got around it by blanketing the amount * -1 / but not flat on why this is what it is for this repo.

Screen Shot 2022-02-23 at 4 13 52 pm
Tarious1 commented 2 years ago

thanks is everything correct now?

johndpope commented 2 years ago

is there a reason why it's backwards?

Tarious1 commented 2 years ago

What was the reason?

johndpope commented 2 years ago

"As you can see in our documentation, Plaid's Transactions product will return positive values when money moves out of an account and negative values when money moves in. For example, debit card purchases are positive; direct deposits and refunds are negative. You will notice that this is the case with all of the transactions in the two screenshots you provided; the alternative backend presents all transactions with the opposite sign."

https://plaid.com/docs/api/products/#transactions-get-response-transactions-amount