Stripe plugin: preventing duplicate payment status updates after 3D Secure

Started by rosydam, Yesterday at 06:07:39 AM

Previous topic - Next topic

rosydam

Hi all,

I've been testing the Stripe plugin for VirtueMart and noticed a strange behavior related to 3D Secure (SCA) payments.

When a customer completes 3D Secure authentication, Stripe sometimes sends multiple webhook events (e.g., payment_intent.succeeded and then charge.succeeded). The issue is that VirtueMart updates the order status twice:

First to Confirmed after the payment intent

Then again to Confirmed or even Pending after the charge event

This leads to confusion in the order history and, in some cases, triggers duplicate email notifications to customers.

Has anyone implemented a safe way to:

Avoid duplicate status changes when multiple events refer to the same payment?

Ensure that once an order is set to a "final" state (e.g., Shipped or Cancelled), later Stripe events won't overwrite it?

I'm considering adding logic in the webhook handler to check the current status before applying updates, but I'd like to know if there's already a recommended best practice for handling these duplicate/late events in VirtueMart.

Any insights or code snippets would be greatly appreciated!

Thanks,
Incredibox