🔀 Merge branch ‘trunk'

This commit is contained in:
Philipp Stracker 2025-03-21 18:03:42 +01:00
commit c4a1217e6a
No known key found for this signature in database
4 changed files with 33 additions and 31 deletions

View file

@ -56,7 +56,7 @@ class CardFieldsRenderer {
onApprove( data ) {
return contextConfig.onApprove( data );
},
onError( error ) {
onError: ( error ) => {
console.error( error );
this.spinner.unblock();
},
@ -106,10 +106,12 @@ class CardFieldsRenderer {
cardFields.submit().catch( ( error ) => {
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
);
}
} );
} );
}

View file

@ -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 );
}

View file

@ -153,7 +153,6 @@ class FeaturesDefinition {
'type' => 'tab',
'tab' => 'payment_methods',
'section' => 'ppcp-credit-card-gateway',
'highlight' => 'ppcp-credit-card-gateway',
'modal' => 'ppcp-credit-card-gateway',
),
'showWhen' => 'enabled',
@ -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',
@ -221,7 +220,6 @@ class FeaturesDefinition {
'type' => 'tab',
'tab' => 'payment_methods',
'section' => 'ppcp-googlepay',
'highlight' => 'ppcp-googlepay',
'modal' => 'ppcp-googlepay',
),
'showWhen' => 'enabled',
@ -259,8 +257,7 @@ class FeaturesDefinition {
'action' => array(
'type' => 'tab',
'tab' => 'payment_methods',
'section' => 'ppcp-card-payments-card',
'highlight' => 'ppcp-applepay',
'section' => 'ppcp-applepay',
'modal' => 'ppcp-applepay',
),
'showWhen' => 'enabled',

View file

@ -32,7 +32,7 @@ return array(
'prefix' => 'WooCommerce\\PayPalCommerce\\Vendor',
'finders' => $finders,
'patchers' => array(),
'exclude-files' => array(), // list<string>.
'exclude-files' => array( 'vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php' ), // list<string>.
'exclude-namespaces' => array(
'/^(?!Psr).*/', // Exclude all namespaces except those starting with "Psr".
), // list<string|regex>.