BenjaminEHowe / yamm-client

The backend for YAMM - a money manager tool.
https://yamm.io
GNU Affero General Public License v3.0
0 stars 0 forks source link

Starling transaction balance incorrect when transactions are pending #4

Open BenjaminEHowe opened 6 years ago

BenjaminEHowe commented 6 years ago

When there are one or more pending transactions (e.g. a mastercard transaction which has not yet settled) the balance for all transactions is incorrectly inflated by the total amount of the pending transactions. This appears to be an issue with the Starling API, caused because transaction balances are calculated from the clearedBalance, as opposed to the effectiveBalance.

Stephan5 commented 6 years ago

Hey @BenjaminEHowe! I have replied on the developer slack but thought I would also say here that we are looking at adding the effective balance to the model for the Transaction API.

We will most likely add both effectiveBalance and clearedBalance to the model and we will deprecate balance to avoid confusion going forward.

BenjaminEHowe commented 6 years ago

I've just set up a 30p pending charge on my Starling account. Below is the opening transaction for the account (partially redacted). It clearly shows a "phantom" 30p, which shouldn't be there (and is caused by the pending transaction). It would be great to fix this by including effectiveBalance and clearedBalance in the model, as these both have clear and well understood meanings.

{
    "amount": 50,
    "direction": "INBOUND",
    "narrative": "Money received from card ending 2554",
    "source": "STRIPE_FUNDING",
    "balance": 50.3
}