diff --git a/modules/ppcp-button/resources/js/modules/Renderer/CardFieldsRenderer.js b/modules/ppcp-button/resources/js/modules/Renderer/CardFieldsRenderer.js index 96196d0cd..15511de69 100644 --- a/modules/ppcp-button/resources/js/modules/Renderer/CardFieldsRenderer.js +++ b/modules/ppcp-button/resources/js/modules/Renderer/CardFieldsRenderer.js @@ -56,9 +56,9 @@ class CardFieldsRenderer { onApprove( data ) { return contextConfig.onApprove( data ); }, - onError( error ) { - console.error( error ); - this.spinner.unblock(); + onError: ( error ) => { + console.error( error ); + this.spinner.unblock(); }, } ); @@ -105,11 +105,13 @@ class CardFieldsRenderer { } cardFields.submit().catch( ( error ) => { - this.spinner.unblock(); - console.error( error ); - this.errorHandler.message( - this.defaultConfig.hosted_fields.labels.fields_not_valid - ); + this.spinner.unblock(); + if (!error.type || error.type !== 'create-order-error') { + console.error( error ); + this.errorHandler.message( + this.defaultConfig.hosted_fields.labels.fields_not_valid + ); + } } ); } ); } diff --git a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Overview/Features/FeatureItem.js b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Overview/Features/FeatureItem.js index 4f3e375d3..85fe38f7c 100644 --- a/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Overview/Features/FeatureItem.js +++ b/modules/ppcp-settings/resources/js/Components/Screens/Settings/Components/Overview/Features/FeatureItem.js @@ -32,7 +32,10 @@ const FeatureItem = ( { ); const handleClick = async ( feature ) => { if ( feature.action?.type === 'tab' ) { - const highlight = Boolean( feature.action?.highlight ); + const highlight = + feature.action?.highlight === undefined + ? true + : Boolean( feature.action.highlight ); const tabId = TAB_IDS[ feature.action.tab.toUpperCase() ]; await selectTab( tabId, feature.action.section, highlight ); } diff --git a/modules/ppcp-settings/src/Data/Definition/FeaturesDefinition.php b/modules/ppcp-settings/src/Data/Definition/FeaturesDefinition.php index 1cc635422..0930ece52 100644 --- a/modules/ppcp-settings/src/Data/Definition/FeaturesDefinition.php +++ b/modules/ppcp-settings/src/Data/Definition/FeaturesDefinition.php @@ -150,11 +150,10 @@ class FeaturesDefinition { 'type' => 'secondary', 'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'action' => array( - 'type' => 'tab', - 'tab' => 'payment_methods', - 'section' => 'ppcp-credit-card-gateway', - 'highlight' => 'ppcp-credit-card-gateway', - 'modal' => 'ppcp-credit-card-gateway', + 'type' => 'tab', + 'tab' => 'payment_methods', + 'section' => 'ppcp-credit-card-gateway', + 'modal' => 'ppcp-credit-card-gateway', ), 'showWhen' => 'enabled', 'class' => 'small-button', @@ -189,7 +188,7 @@ class FeaturesDefinition { 'type' => 'tab', 'tab' => 'payment_methods', 'section' => 'ppcp-alternative-payments-card', - 'highlight' => 'ppcp-alternative-payments-card', + 'highlight' => false, ), 'showWhen' => 'enabled', 'class' => 'small-button', @@ -218,11 +217,10 @@ class FeaturesDefinition { 'type' => 'secondary', 'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'action' => array( - 'type' => 'tab', - 'tab' => 'payment_methods', - 'section' => 'ppcp-googlepay', - 'highlight' => 'ppcp-googlepay', - 'modal' => 'ppcp-googlepay', + 'type' => 'tab', + 'tab' => 'payment_methods', + 'section' => 'ppcp-googlepay', + 'modal' => 'ppcp-googlepay', ), 'showWhen' => 'enabled', 'class' => 'small-button', @@ -257,11 +255,10 @@ class FeaturesDefinition { 'type' => 'secondary', 'text' => __( 'Configure', 'woocommerce-paypal-payments' ), 'action' => array( - 'type' => 'tab', - 'tab' => 'payment_methods', - 'section' => 'ppcp-card-payments-card', - 'highlight' => 'ppcp-applepay', - 'modal' => 'ppcp-applepay', + 'type' => 'tab', + 'tab' => 'payment_methods', + 'section' => 'ppcp-applepay', + 'modal' => 'ppcp-applepay', ), 'showWhen' => 'enabled', 'class' => 'small-button', diff --git a/scoper.inc.php b/scoper.inc.php index dd73d2b36..66ae7017c 100644 --- a/scoper.inc.php +++ b/scoper.inc.php @@ -32,20 +32,20 @@ return array( 'prefix' => 'WooCommerce\\PayPalCommerce\\Vendor', 'finders' => $finders, 'patchers' => array(), - 'exclude-files' => array(), // list. + 'exclude-files' => array( 'vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php' ), // list. 'exclude-namespaces' => array( '/^(?!Psr).*/', // Exclude all namespaces except those starting with "Psr". ), // list. 'exclude-constants' => array(), // list. - 'exclude-classes' => array(), // list. + 'exclude-classes' => array(), // list. 'exclude-functions' => array(), // list. 'expose-global-constants' => false, // bool. - 'expose-global-classes' => false, // bool. + 'expose-global-classes' => false, // bool. 'expose-global-functions' => false, // bool. 'expose-namespaces' => array(), // list. - 'expose-constants' => array(), // list. - 'expose-classes' => array(), // list. - 'expose-functions' => array(), // list. + 'expose-constants' => array(), // list. + 'expose-classes' => array(), // list. + 'expose-functions' => array(), // list. );