Skip to content

PB Transactions return balance of 0, then update to actual balance #29

@programmable-banking-community

Description

Discussed in https://github.com/orgs/Investec-Developer-Community/discussions/9

Originally posted by scholtz-gnome March 25, 2024

Bug

When making a payment and making a transfer between my general account and Prime Saver, both transactions returned a running_balance of 0 and the transfer had the description different from what I expected.

Expected Behaviour

Usually the description for a transfer looks something like this:

Internal Transaction PMC Inbounds Value Date 20Mar23 MBP<some number> <accountNumber> <provided description>

However, the description for the transfer was only the <provided description>.

For both the payment and transfer, the running_balance returned 0 when it definitely wasn't 0.

After a few minutes, these were updated.

How I found out

I am saving transactions I receive from the Investec API in a local Postgres DB. When updating a list of transactions, I retrieve the last 7 days, in case there were pending transactions I missed. To make sure I don't duplicate transactions, though, I have created a SQL uniqueness constraint on description, transaction_date and running_balance. If those all match/conflict, then I update a record rather than create a new one. Thing is, I ended up saving transactions that were the same because the running balance was initially 0 and then the actual balance.

Fix

Either a transaction shouldn't be returned from the API until the running balance has been updated correctly or the fields that may update should be documented, so we can update them on our side.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions