Basically, there are 4 types of transfers present in the business logic of the application I am working on:
- Dwolla Wallet → Dwolla Wallet
- Dwolla Wallet → Bank account
- Bank account → Dwolla Wallet
- Bank account → Bank account
After doing some research on the forum I have discovered, that storing the trasnfers data and updating it when related webhooks hit the server is a great approach. Up to this moment, I am receiving webhook events and updaing a transfer record status extracting the status from the event topic. But, because of the fact, that there are several transfer-related entites get created in the Dwolla system for the trasnfer types 2-4, it sets created status several times when it should not, logically.
Unfortunately, I could not invent a universal approach on how to track transfer statuses properly for each of the transfer types. It is said in the docs that webhook events are sent in async order, so I cannot rely on their arrival time. Could you, please, provide some pieces of advice on how to process events and set the status properly, as well as figuring out the latest transfer status available.
I use correlation id in order to distinguish orders one from another.
Thanks, in advance.