Add WC subscriptions support when subscription mode is subscriptions api

This commit is contained in:
Emili Castells Guasch 2023-05-03 14:53:23 +02:00
parent b2c2a084e9
commit 71cf5516d7
2 changed files with 8 additions and 2 deletions

View file

@ -180,7 +180,10 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
'products',
);
if ( $this->config->has( 'vault_enabled_dcc' ) && $this->config->get( 'vault_enabled_dcc' ) ) {
if (
( $this->config->has( 'vault_enabled_dcc' ) && $this->config->get( 'vault_enabled_dcc' ) )
|| ( $this->config->has( 'subscriptions_mode' ) && $this->config->get( 'subscriptions_mode' ) === 'subscriptions_api' )
) {
array_push(
$this->supports,
'subscriptions',

View file

@ -223,7 +223,10 @@ class PayPalGateway extends \WC_Payment_Gateway {
'products',
);
if ( $this->config->has( 'vault_enabled' ) && $this->config->get( 'vault_enabled' ) ) {
if (
( $this->config->has( 'vault_enabled' ) && $this->config->get( 'vault_enabled' ) )
|| ( $this->config->has( 'subscriptions_mode' ) && $this->config->get( 'subscriptions_mode' ) === 'subscriptions_api' )
) {
array_push(
$this->supports,
'tokenization',