mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Check if variable exist before calling it, persist vault enabled when token creation fails
This commit is contained in:
parent
ebc4316f83
commit
145b8085ab
2 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,7 @@
|
|||
atLeastOneChecked(payLaterMessagingCheckboxes) ? disableAll(vaultingCheckboxes) : enableAll(vaultingCheckboxes)
|
||||
atLeastOneChecked(vaultingCheckboxes) ? disableAll(payLaterMessagingCheckboxes) : enableAll(payLaterMessagingCheckboxes)
|
||||
|
||||
if(PayPalCommerceGatewaySettings.vaulting_features_available !== '1' ) {
|
||||
if(typeof PayPalCommerceGatewaySettings === 'undefined' || PayPalCommerceGatewaySettings.vaulting_features_available !== '1' ) {
|
||||
disableAll(vaultingCheckboxes)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -156,6 +156,9 @@ class SettingsListener {
|
|||
return;
|
||||
}
|
||||
} catch ( RuntimeException $exception ) {
|
||||
$this->settings->set( 'vault_enabled', false );
|
||||
$this->settings->persist();
|
||||
|
||||
add_action(
|
||||
'admin_notices',
|
||||
function () use ( $exception ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue