Closed james-allan closed 9 months ago
@mattallan while testing this PR was observing a strange bug. If there was a failed early renewal order in the cart, doing other things like creating standard renewal orders would lead to it being created with a failed order status by default. So to replicate that bug you would:
This may be an intermittent bug. I wasn't able to replicate this even though I could observe the maybe_preserve_order_status()
function returning a failed status while a failed early renewal was in the cart. 🤷♂️
In any case, this function is no longer needed and is very error prone given it affects all default order statuses while the cart contains a failed order.
Fixes https://github.com/woocommerce/woocommerce-subscriptions/issues/4404
Description
The
$subscription->needs_payment()
function use to check the last renewal or switch even if the last renewal order was an early renewal order.Early renewal orders are optional and so should not have any bearing on whether a subscription needs payment.
If you look at the uses of
needs_payment()
, it's currently only used in a handful of places.In my opinion none of these should use early renewal orders to determine if the subscription requires payment.
How to test this PR
4000000000000002
trunk
you cannot reactivate.Product impact