Skip to content

Commit

Permalink
Merge branch 'develop' into update/pass-previous-error-to-exception
Browse files Browse the repository at this point in the history
  • Loading branch information
hsingyuc authored May 22, 2024
2 parents ac703a2 + 80f9999 commit 3b1598e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
4 changes: 4 additions & 0 deletions changelog/fix-blocks-checkout-ece-error-when-prb-disabled
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fix

Fix ECE error in the blocks checkout when PRBs are disabled.
5 changes: 5 additions & 0 deletions changelog/fix-blocks-page-detection-for-woopay
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: fix
Comment: Fixes an unreleased bug


Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const expressCheckoutIframe = async ( api, context, emailSelector ) => {
userEmail = email;
urlParams.append( 'email', email );
}
urlParams.append( 'is_blocks', !! wcSettings.wcBlocksConfig );
urlParams.append( 'is_blocks', !! window.wcSettings?.wcBlocksConfig );
urlParams.append( 'is_express', 'true' );
urlParams.append( 'express_context', context );
urlParams.append( 'source_url', window.location.href );
Expand Down
14 changes: 12 additions & 2 deletions client/express-checkout/blocks/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global wcpayConfig */
/* global wcpayConfig, wcpayExpressCheckoutParams */

/**
* Internal dependencies
Expand All @@ -16,7 +16,17 @@ const expressCheckoutElementPaymentMethod = ( api ) => ( {
supports: {
features: getConfig( 'features' ),
},
canMakePayment: () => wcpayConfig.isExpressCheckoutElementEnabled,
canMakePayment: () => {
if ( typeof wcpayExpressCheckoutParams === 'undefined' ) {
return false;
}

if ( typeof wcpayConfig !== 'undefined' ) {
return wcpayConfig.isExpressCheckoutElementEnabled;
}

return false;
},
} );

export default expressCheckoutElementPaymentMethod;
7 changes: 5 additions & 2 deletions client/payment-request/blocks/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* global wcpayConfig */
/* global wcpayConfig, wcpayPaymentRequestParams */

/**
* Internal dependencies
Expand Down Expand Up @@ -28,7 +28,10 @@ const paymentRequestPaymentMethod = ( api ) => ( {
return false;
}

if ( wcpayConfig.isExpressCheckoutElementEnabled ) {
if (
typeof wcpayConfig !== 'undefined' &&
wcpayConfig.isExpressCheckoutElementEnabled
) {
return false;
}

Expand Down

0 comments on commit 3b1598e

Please sign in to comment.