Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide Express Checkout in block editor if disabled #3523

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Fix - Display a notice if taxes vary by customer's billing address when checking out using the Stripe Express Checkout Element.
* Tweak - Makes the new Stripe Express Checkout Element enabled by default in new accounts.
* Dev - Add multiple unit tests for the Stripe Express Checkout Element implementation (for both frontend and backend).
* Fix - Do not show Express Payment block in block editor if it's not enabled as a payment method.
* Fix - Check if taxes are enabled when applying ECE tax compatibility check.
* Fix - Fix ECE error when initial address on load is not defined as a shipping zone.
* Fix - Corrected card brand capitalization on the My Account → Subscription page.
Expand Down
8 changes: 6 additions & 2 deletions client/blocks/upe/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ Object.entries( paymentMethodsConfig )
} );
} );

if ( getBlocksConfiguration()?.isECEEnabled ) {
const blocksConfig = getBlocksConfiguration();
if (
blocksConfig?.isECEEnabled &&
blocksConfig?.shouldShowExpressCheckoutButton
) {
// Register Express Checkout Element.
registerExpressPaymentMethod( expressCheckoutElementsGooglePay( api ) );
registerExpressPaymentMethod( expressCheckoutElementsApplePay( api ) );
registerExpressPaymentMethod( expressCheckoutElementsStripeLink( api ) );
} else {
} else if ( blocksConfig?.shouldShowPaymentRequestButton ) {
// Register Stripe Payment Request.
registerExpressPaymentMethod( paymentRequestPaymentMethod );
}
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
* Fix - Display a notice if taxes vary by customer's billing address when checking out using the Stripe Express Checkout Element.
* Tweak - Makes the new Stripe Express Checkout Element enabled by default in new accounts.
* Dev - Add multiple unit tests for the Stripe Express Checkout Element implementation (for both frontend and backend).
* Fix - Do not show Express Payment block in block editor if it's not enabled as a payment method.
* Fix - Check if taxes are enabled when applying ECE tax compatibility check.
* Fix - Fix ECE error when initial address on load is not defined as a shipping zone.
* Fix - Corrected card brand capitalization on the My Account → Subscription page.
Expand Down
Loading