Hi @gerold1968
Thank you for contacting Payment Plugins. The plugin will early return a 200 response code to the payment_intent.succeeded webhook if the order has already been paid or there is an order lock, which lasts 2 minutes. If that happens, the following log entry is written to the wc-stripe log file:
payment_intent.succeeded event received. Intent has been completed for order %s. Event exited.
But the order lock is only applied in certain conditions like a local payment method being processed. The order lock prevents the webhook from double processing a request.
Typically the order status is not managed by the webhook events. It’s only for payment methods that take hours or days to process that the order status is managed by the webhook event.
Kind Regards
Hey there, thx for super-fast reply with tech insight. I appreciate!
Best Gerold
Hi Clayton,
I was able to narrow this down further.
For affected orders (order-pay / retry cases):
payment_intent.succeeded webhook is received (200 OK)
- Action Scheduler job
wc_stripe_process_deferred_webhook is created and completed
- but the order remains
pending
- no transaction ID
- no “payment completed” order note
Example scheduled action data:
- type:
payment_intent.succeeded
- order_id:
23555
- payment_intent:
pi_3TExngHodsEAhbgg555cOu
From reviewing the code of the plugin, the issue seems to be in the deferred handler:
- it ignores the scheduled
payment_intent argument
- it does not sync
_payment_intent meta from the webhook payload
- it relies solely on
process_payment( $order )
- and it has no logging if that returns
WP_Error or complete_payment = false
So in these cases, the webhook is received and processed, but the deferred handler silently exits without completing the order.
This seems to affect order-pay / reused pending orders specifically, where local order state and Stripe state may be out of sync.
Best,
Gerold
Best Gerold
Hi @gerold1968
it ignores the scheduled payment_intent argument
It’s not ignoring the argument, it just doesn’t need it. The plugin fetches the payment intent object in the process_payment method. You should never rely on a stale object but rather fetch the object when the scheduled job runs. That ensures you have the most up to date data, which is what the plugin does.
I will have that code re-tested but based on past test scripts there aren’t any issues with how the deferred webhook handler works.
Kind Regards
Hi, I figured it out for my setup. Suggestion: log if a webhook is recieved but no actio taken?
Best Gerold
Hi @gerold1968
For the payment_intent.succeeded event the plugin does log the following message:
payment_intent.succeeded event received. Intent has been completed for order %s. Event exited.
What was the root cause?
Kind Regards
Hi, I meant to log if a webhook is sent with no errors (200) BUT the order isnt updated to paid.
I am not sure about the root cause by now, I cant reproduce it on staging, so troubleshooting is difficult.
Best Gerold