Skip to content

fix(plugin-ecommerce): verify PaymentIntent succeeded before creating…#15902

Merged
paulpopus merged 4 commits intopayloadcms:mainfrom
nehaaprasad:fix/plg-crt-ord-paymnt
Apr 16, 2026
Merged

fix(plugin-ecommerce): verify PaymentIntent succeeded before creating…#15902
paulpopus merged 4 commits intopayloadcms:mainfrom
nehaaprasad:fix/plg-crt-ord-paymnt

Conversation

@nehaaprasad
Copy link
Copy Markdown
Contributor

what?

Prevents stripe/confirm-order from creating an order unless the Stripe PaymentIntent is actually successful.

Why?

  • Failed or canceled payments could still create an order, mark the cart as purchased, and set the transaction to succeeded.

How?

  • After retrieving the PaymentIntent, check paymentIntent.status === 'succeeded'.
    If not, throw an error and stop before any order/cart/transaction updates.

Fixes #15862

paulpopus
paulpopus previously approved these changes Apr 16, 2026
@paulpopus paulpopus enabled auto-merge (squash) April 16, 2026 19:47
@paulpopus paulpopus merged commit 500e39d into payloadcms:main Apr 16, 2026
166 checks passed
milamer pushed a commit to milamer/payload that referenced this pull request Apr 20, 2026
payloadcms#15902)

### what?
Prevents stripe/confirm-order from creating an order unless the Stripe
PaymentIntent is actually successful.

### Why?
- Failed or canceled payments could still create an order, mark the cart
as purchased, and set the transaction to succeeded.

### How?
- After retrieving the PaymentIntent, check paymentIntent.status ===
'succeeded'.
If not, throw an error and stop before any order/cart/transaction
updates.

Fixes payloadcms#15862

---------

Co-authored-by: Paul Popus <paul@payloadcms.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plugin-ecommerce: confirmOrder creates order without verifying PaymentIntent status

3 participants