feat(medusa-payment-stripe): Add delay to Stripe webhook (#5838)
**What** - Migrate Stripe plugin to use API Routes + Subscribers - Change the behaviour of Stripe webhook Instead of processing webhook events immediately, we fire an event to perform the work in the background. The primary reason for changing the webhook is that the previous implementation led to occasional conflicts due to a race condition between the client's and the webhook's request to complete a cart. Now, we emit an event with a configurable delay (defaults to 2s) to prevent this from happening This approach was preferred over adding a timeout directly to the webhook execution, as it is generally best practice to respond to a webhook event immediately after receiving it.
This commit is contained in:
1 parent
37fba9a168
commit
99a4f94db5
16 files changed
+92
-98
No files matched your search
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
"medusa-payment-stripe": patch
|
||||
---
|
||||
|
||||
feat(medusa-payment-stripe): Add delay to Stripe webhook
|
||||
Reference in new issue
Block a user