diff --git a/modules/ppcp-blocks/resources/js/Components/paypal.js b/modules/ppcp-blocks/resources/js/Components/paypal.js index 5edb270b2..1ff82f3fe 100644 --- a/modules/ppcp-blocks/resources/js/Components/paypal.js +++ b/modules/ppcp-blocks/resources/js/Components/paypal.js @@ -136,17 +136,7 @@ export const PayPalComponent = ( { window.ppcpFundingSource = data.fundingSource; - let activePaymentMethod = wp.data - .select( 'wc/store/payment' ) - .getActivePaymentMethod(); - console.log( activePaymentMethod, 'activePaymentMethod' ); - onClick(); - - activePaymentMethod = wp.data - .select( 'wc/store/payment' ) - .getActivePaymentMethod(); - console.log( activePaymentMethod, 'activePaymentMethod' ); }; const shouldHandleShippingInPayPal = () => { diff --git a/modules/ppcp-googlepay/resources/js/GooglepayButton.js b/modules/ppcp-googlepay/resources/js/GooglepayButton.js index 3ba370b00..938f875e0 100644 --- a/modules/ppcp-googlepay/resources/js/GooglepayButton.js +++ b/modules/ppcp-googlepay/resources/js/GooglepayButton.js @@ -549,7 +549,6 @@ class GooglepayButton extends PaymentButton { /** * Show Google Pay payment sheet when Google Pay payment button is clicked - * @param onClick */ async onButtonClick() { this.logGroup( 'onButtonClick' ); @@ -557,18 +556,9 @@ class GooglepayButton extends PaymentButton { const initiatePaymentRequest = async () => { window.ppcpFundingSource = 'googlepay'; - let activePaymentMethod = wp.data - .select( 'wc/store/payment' ) - .getActivePaymentMethod(); - console.log( activePaymentMethod, 'activePaymentMethod' ); - + // Set active payment method the paymentMethodId in registerExpressPaymentMethod. this.onClick(); - activePaymentMethod = wp.data - .select( 'wc/store/payment' ) - .getActivePaymentMethod(); - console.log( activePaymentMethod, 'activePaymentMethod' ); - const paymentDataRequest = this.paymentDataRequest(); this.log( diff --git a/modules/ppcp-googlepay/resources/js/boot-block.js b/modules/ppcp-googlepay/resources/js/boot-block.js index 089c89fda..735dd9df2 100644 --- a/modules/ppcp-googlepay/resources/js/boot-block.js +++ b/modules/ppcp-googlepay/resources/js/boot-block.js @@ -91,6 +91,7 @@ if ( buttonConfig?.is_enabled ) { 'woocommerce-paypal-payments' ), gatewayId: 'ppcp-gateway', + paymentMethodId: 'ppcp-gateway', label:
, content: , edit: ,