[Split PE] Fixes error on block checkout when attempting to pay for failed renewal with a saved card #2906
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2904
Changes proposed in this Pull Request:
This issue is fairly edge case, nevertheless, after changing a subscription's payment method via the My Account > View Subscription page, this incorrectly stores the
_stripe_setup_intent
metadata on the subscription which then gets copied to future renewal orders.If a renewal order fails and has this setup_intent data, when a customer attempts to pay for the renewal order with a saved card on the checkout block, they will get an error on the checkout.

After digging into error there are actually two main issues at play:
wc-stripe-is-deferred-intent
data, when using a standard Stripe saved card. This causes theprocess_payment()
function to callprocess_payment_with_saved_payment_method()
instead of the expectedprocess_payment_with_deferred_intent()
. Fixed by 7d32890Testing instructions
add/deferred-intent
branchadd/deferred-intent
4000000000000341
changelog.txt
andreadme.txt
(or does not apply)Post merge