Pass the PM back to the JS to ensure it can be confirmed on the checkout if it requires 3DS confirmation #2909
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 #2905
Changes proposed in this Pull Request:
If you signed up to a subscription on the Block checkout, using a 3DS card, the subscription would eventually get created without a complete set of payment meta.
This PR fixes that.
For some background, this change puts the block checkout inline with classic checkout.
The classic checkout handles this by passing the
confirmIntent()
function the payment method ID (code ref) that then leads the to theconfirmIntent()
function to pass the payment method ID to theupdate_order_status
AJAX request (https://github.com/woocommerce/woocommerce-gateway-stripe/blob/fix/2905-set-payment-method-on-3ds-confirmation/client/api/index.js#L318) which then leads to the payment method being saved here.Blocks is a little different.
Classic checkouts store the
PM_
in a hidden element that can be pulled from. Block checkouts don't have that so I need to return it via the payment response (this is inline with how WooPayments does it).On the classic checkout, the save payment method checkbox is also automatically checked if we require it to be saved (eg if the cart contains a subscription). That's not how it works on the Block checkout either. Because we don't show the checkbox, the
shouldSavePayment
isfalse
. This PR makes sure it is set to true if the cart contains a subscription (ie we are required to save the payment method).Testing instructions
4000 0025 0000 3155
.add/deferred-intent
if you view the subscription it will be missing the customer ID.add/deferred-intent
changelog.txt
andreadme.txt
(or does not apply)Post merge