mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Fix typos getting settings and reverse conditionals to check for true first
This commit is contained in:
parent
a291c0da1a
commit
ca82a46383
2 changed files with 15 additions and 12 deletions
|
@ -955,17 +955,19 @@ class SmartButton implements SmartButtonInterface {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks if vault setting is either enabled for PayPal or credit card.
|
||||
* Checks if vault enabled setting for PayPal or credit card is enabled.
|
||||
*
|
||||
* @return bool Whether any of them is enabled or not.
|
||||
* @throws \WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException When a setting hasn't been found.
|
||||
*/
|
||||
protected function vault_settings_enabled(): bool {
|
||||
if ( ! $this->settings->has( 'vault_enabled' ) && ! $this->settings->has( 'dcc_vault_enabled' )
|
||||
|| ! $this->settings->get( 'dcc_vault_enabled' ) && ! $this->settings->get( 'dcc_vault_enabled' ) ) {
|
||||
return false;
|
||||
if ( $this->settings->has( 'vault_enabled' ) && $this->settings->get( 'vault_enabled' ) ) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
if ( $this->settings->has( 'dcc_vault_enabled' ) && $this->settings->get( 'dcc_vault_enabled' ) ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -975,7 +977,7 @@ class SmartButton implements SmartButtonInterface {
|
|||
* @throws \WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException When a setting hasn't been found.
|
||||
*/
|
||||
protected function vault_card_setting_enabled(): bool {
|
||||
if ( ! $this->settings->get( 'dcc_vault_enabled' ) && ! $this->settings->get( 'dcc_vault_enabled' ) ) {
|
||||
if ( ! $this->settings->has( 'dcc_vault_enabled' ) && ! $this->settings->get( 'dcc_vault_enabled' ) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -87,17 +87,18 @@ trait ProcessPaymentTrait {
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks if vault setting is either enabled for PayPal or Credit Card.
|
||||
* Checks if vault enabled setting for PayPal or credit card is enabled.
|
||||
*
|
||||
* @return bool Whether vault settings are enabled or not.
|
||||
* @throws \WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException When a setting hasn't been found.
|
||||
*/
|
||||
protected function vault_settings_enabled(): bool {
|
||||
if ( ! $this->config->has( 'vault_enabled' ) && ! $this->config->has( 'dcc_vault_enabled' )
|
||||
|| ! $this->config->get( 'dcc_vault_enabled' ) && ! $this->config->get( 'dcc_vault_enabled' ) ) {
|
||||
return false;
|
||||
if ( $this->config->has( 'vault_enabled' ) && $this->config->get( 'vault_enabled' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
if ( $this->config->has( 'dcc_vault_enabled' ) && $this->config->get( 'dcc_vault_enabled' ) ) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue