You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
of0
and the transfer had thedescription
different from what I expected.Expected Behaviour
Usually the
description
for a transfer looks something like this:However, the description for the transfer was only the
<provided description>
.For both the payment and transfer, the
running_balance
returned0
when it definitely wasn't0
.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
andrunning_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 initially0
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.
The text was updated successfully, but these errors were encountered: