I’m using Dwolla OAuth+Send to enable my customers to pay me. I’m doing:
- Send user to OAuth, get ‘authorization code’
- Exchange code for access/refresh tokens.
- initiate ‘send’ Transaction.
- As a result of step 3, i get a transactionId, which I write to my db with the transaction’s details.
- When the webhook is triggered, it contains the transactionId, allowing me to update the db row corresponding to that transaction.
Problem is, its possible for the db write in step 4 to take a while (db contention, or other delays). That creates the possibility that the webhook could trigger before the row is safely written to the db. The webhook code would then see a transactionId that has no corresponding row in the db, and exit.
This seems to be either a design flaw in the API, or maybe I’m just using it wrong. Any ideas?