mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
🔀 Merge branch ‘trunk'
This commit is contained in:
commit
c4a1217e6a
4 changed files with 33 additions and 31 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
} );
|
||||
} );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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',
|
||||
|
|
|
@ -32,20 +32,20 @@ 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>.
|
||||
'exclude-constants' => array(), // list<string|regex>.
|
||||
'exclude-classes' => array(), // list<string|regex>.
|
||||
'exclude-classes' => array(), // list<string|regex>.
|
||||
'exclude-functions' => array(), // list<string|regex>.
|
||||
|
||||
'expose-global-constants' => false, // bool.
|
||||
'expose-global-classes' => false, // bool.
|
||||
'expose-global-classes' => false, // bool.
|
||||
'expose-global-functions' => false, // bool.
|
||||
|
||||
'expose-namespaces' => array(), // list<string|regex>.
|
||||
'expose-constants' => array(), // list<string|regex>.
|
||||
'expose-classes' => array(), // list<string|regex>.
|
||||
'expose-functions' => array(), // list<string|regex>.
|
||||
'expose-constants' => array(), // list<string|regex>.
|
||||
'expose-classes' => array(), // list<string|regex>.
|
||||
'expose-functions' => array(), // list<string|regex>.
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue