hide vaulting behind flag

This commit is contained in:
David Remer 2020-08-19 11:37:18 +03:00
parent 6fd8cbb7b3
commit 05be224b65
3 changed files with 7 additions and 3 deletions

View file

@ -151,7 +151,7 @@ return [
'save',
'reset'
);
return [
$fields = [
'ppcp_onboarding' => [
'title' => __('Connect to PayPal', 'woocommerce-paypal-commerce-gateway'),
'type' => 'ppcp_onboarding',
@ -1476,6 +1476,10 @@ return [
'gateway' => 'dcc',
],
];
if (! defined('PPCP_FLAG_SUBSCRIPTION') || ! PPCP_FLAG_SUBSCRIPTION) {
unset($fields['vault_enabled']);
}
return $fields;
},
'wcgateway.checkout.address-preset' => static function(ContainerInterface $container): CheckoutPayPalAddressPreset {

View file

@ -30,7 +30,7 @@ class CreditCardGateway extends PayPalGateway
$this->notice = $notice;
$this->settingsRenderer = $settingsRenderer;
$this->config = $config;
if ($this->config->has('vault_enabled') && $this->config->get('vault_enabled')) {
if (defined('PPCP_FLAG_SUBSCRIPTION') && PPCP_FLAG_SUBSCRIPTION && $this->config->has('vault_enabled') && $this->config->get('vault_enabled')) {
$this->supports = [
'products',
'subscriptions',

View file

@ -50,7 +50,7 @@ class PayPalGateway extends \WC_Payment_Gateway
$this->notice = $notice;
$this->settingsRenderer = $settingsRenderer;
$this->config = $config;
if ($this->config->has('vault_enabled') && $this->config->get('vault_enabled')) {
if (defined('PPCP_FLAG_SUBSCRIPTION') && PPCP_FLAG_SUBSCRIPTION && $this->config->has('vault_enabled') && $this->config->get('vault_enabled')) {
$this->supports = [
'products',
'subscriptions',