Skip to content

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

Open
nehaaprasad wants to merge 1 commit intopayloadcms:mainfrom
nehaaprasad:fix/plg-crt-ord-paymnt
Open

fix(plugin-ecommerce): verify PaymentIntent succeeded before creating…#15902
nehaaprasad wants to merge 1 commit intopayloadcms:mainfrom
nehaaprasad:fix/plg-crt-ord-paymnt

Conversation

@nehaaprasad
Copy link
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

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

1 participant