[ECE] Hide express checkout if cards are disabled #3589
Merged
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 #3546
Changes proposed in this Pull Request:
When credit cards are not enabled, using Apple Pay/Google Pay will result in an
Invalid payment method
error. This is because checkout fails validation due to thestripe
payment gateway not being available.In this PR, when credit cards are not enabled, we will not display Apple Pay/Google Pay for block cart and block checkout, as well as the wp-admin Payment Methods page. This is already the behavior for shortcode checkout, shortcode cart and product pages.
In #3593, we will investigate whether we can (and want to) make express checkout work even when cards are not enabled. This PR is focused only on avoiding presenting a broken payment method to the customer.
Testing instructions
Test for wp-admin changes
Credit card / debit card
as a payment method.develop
, the Express checkout section still displays Apple Pay/Google Pay as an option.Test for store-side changes
develop
.Credit card / debit card
as a payment method, but enableApple Pay/Google Pay
Invalid payment method
error.WC_Stripe_Feature_Flags::is_stripe_ece_enabled()
.Screenshots
Admin-side changes: When
Credit card / debit card
is disabled,Apple Pay/Google Pay
is hidden, similar to how it Link already behaves.changelog.txt
andreadme.txt
(or does not apply)Post merge