How a missing database update caused refunds to vanish in a NestJS payment system
A startup founder discovered that customers were not receiving refunds despite the payment provider confirming they had been processed. The root cause was a NestJS backend that called the provider's refund endpoint but failed to update its own database if anything interrupted execution afterward. Because the internal ledger never recorded the refund, no confirmation email was sent and support had no visibility into what had gone wrong. The fix involved treating each refund as a separate database event logged before the provider is even called, ensuring a record always exists regardless of later failures. A background notification queue was also added so customer emails are dispatched only after the refund is fully confirmed in the system.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in