Skip to content

Commit

Permalink
fix(medusa-payment-stripe): Resend capture event to ensure auto-captu…
Browse files Browse the repository at this point in the history
…re (#3100)
  • Loading branch information
olivermrbl committed Jan 25, 2023
1 parent 2e7e16b commit 0009da0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/selfish-pianos-wonder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"medusa-payment-stripe": patch
---

fix(medusa-payment-stripe): Resend capture event to ensure auto-capture
3 changes: 3 additions & 0 deletions packages/medusa-payment-stripe/src/api/routes/hooks/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export default async (req, res) => {
await manager.transaction(async (manager) => {
await orderService.withTransaction(manager).capturePayment(order.id)
})
} else {
// If we receive the event, before the order is created, we respond with 404 as this will trigger Stripe to resend the event later
return res.sendStatus(404)
}
break
case "payment_intent.amount_capturable_updated":
Expand Down

0 comments on commit 0009da0

Please sign in to comment.