Closed mattallan closed 2 weeks ago
@mattallan We are experiencing what I believe is this bug on a client's WooCommerce Subscription site which has Object Caching Pro on Nexcess WooCommerce Hosting. We noticed that since October 15th we've had 410 Virtual Renewal Orders changed to "Processing" instead of "Completed". This is most likely due to the the integration with Autocomplete WooCommerce Orders which seems to mark the first event as "Complete" but the second one stays as "Processing". This is happening on a majority of renewal orders but not all.
I think it may be related to this issue as well but these are paid and not manual orders: https://github.com/Automattic/woocommerce-subscriptions-core/issues/707
WooCommerce Stripe Gateway Version 8.8.1 WooCommerce Subscriptions Version 6.8.0 WooCommerce Version 9.3.3 Autocomplete WooCommerce Orders Version 3.3.6 Object Cache Pro Version 1.21.3
I'm going to check other clients in this scenario.
One of my clients' websites is experiencing the same issue. Hopefully, a patch will be released soon.
Renewal Order | Subscription |
---|---|
Plugins:
WooCommerce Stripe Gateway Version 8.8.0 WooCommerce Subscriptions Version 6.8.0 WooCommerce Version 9.3.3
No object cache plugins are installed.
Describe the bug
While processing subscription renewal payments, we are unlocking the order too early in the process leaving a small window for the
payment_intent.succeeded
webhook sent by Stripe to validate and proceed to mark the order as payment complete in parallel with the current request.Here's a quick breakdown of our
process_subscription_payment()
function:From above, if there are delays in fetching the latest charge from Stripe, this gives time for the
payment_intent.succeeded
to be sent and because the order is still pending, this results in both requests eventually marking the order aspayment_complete()
.To Reproduce
To replicate this consistently, I had to add a small
sleep( 2 );
between fetching the latest charge from Stripe and calling process_response() (here). While it seems hacky, this change in a sense just simulates a slow Stripe request to fetch a charge object which can happen.4242424242424242