diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index a7237c4f0..013c8f2b3 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -239,10 +239,6 @@ class SmartButton implements SmartButtonInterface { $this->render_message_wrapper_registrar(); } - if ( ! $this->can_save_vault_token() && $this->has_subscriptions() ) { - return false; - } - if ( $this->settings->has( 'dcc_enabled' ) && $this->settings->get( 'dcc_enabled' ) @@ -444,10 +440,6 @@ class SmartButton implements SmartButtonInterface { add_action( $this->mini_cart_button_renderer_hook(), function () { - if ( ! $this->can_save_vault_token() && $this->has_subscriptions() ) { - return; - } - if ( $this->is_cart_price_total_zero() || $this->is_free_trial_cart() ) { return; } @@ -559,10 +551,6 @@ class SmartButton implements SmartButtonInterface { */ public function button_renderer( string $gateway_id ) { - if ( ! $this->can_save_vault_token() && $this->has_subscriptions() ) { - return; - } - $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); if ( ! isset( $available_gateways[ $gateway_id ] ) ) { @@ -578,9 +566,6 @@ class SmartButton implements SmartButtonInterface { * Renders the HTML for the credit messaging. */ public function message_renderer() { - if ( ! $this->can_save_vault_token() && $this->has_subscriptions() ) { - return false; - } $product = wc_get_product(); diff --git a/modules/ppcp-wc-gateway/src/Gateway/CardButtonGateway.php b/modules/ppcp-wc-gateway/src/Gateway/CardButtonGateway.php index 9b5980f39..524615f18 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/CardButtonGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/CardButtonGateway.php @@ -174,7 +174,7 @@ class CardButtonGateway extends \WC_Payment_Gateway { if ( $this->onboarded ) { $this->supports = array( 'refunds' ); } - if ($this->gateways_enabled() && $this->vault_setting_enabled()) { + if ($this->gateways_enabled()) { $this->supports = array( 'refunds', 'products', diff --git a/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php b/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php index 8e6db5744..b1bff7696 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php @@ -174,7 +174,7 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC { if ( $state->current_state() === State::STATE_ONBOARDED ) { $this->supports = array( 'refunds' ); } - if ($this->gateways_enabled() && $this->vault_setting_enabled()) { + if ($this->gateways_enabled()) { $this->supports = array( 'refunds', 'products', diff --git a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php index cc6dbb656..ff70428fe 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/PayPalGateway.php @@ -204,7 +204,7 @@ class PayPalGateway extends \WC_Payment_Gateway { if ( $this->onboarded ) { $this->supports = array( 'refunds' ); } - if ($this->gateways_enabled() && $this->vault_setting_enabled()) { + if ($this->gateways_enabled()) { $this->supports = array( 'refunds', 'products', diff --git a/modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php b/modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php index da17f822b..e983333bc 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php +++ b/modules/ppcp-wc-gateway/src/Gateway/ProcessPaymentTrait.php @@ -33,19 +33,6 @@ trait ProcessPaymentTrait { return false; } - /** - * Checks if vault setting 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_setting_enabled(): bool { - if ( $this->config->has( 'vault_enabled' ) && $this->config->get( 'vault_enabled' ) ) { - return true; - } - return false; - } - /** * Scheduled the vaulted payment check. *