Add subscriptions support for PayPal and ACDC gateways

This commit is contained in:
Emili Castells Guasch 2023-04-27 17:07:30 +02:00
parent d3d74a67b6
commit d9fa6e2c5d
3 changed files with 36 additions and 23 deletions

View file

@ -174,21 +174,27 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC {
if ( $state->current_state() === State::STATE_ONBOARDED ) {
$this->supports = array( 'refunds' );
}
if ( $this->gateways_enabled() ) {
if ( $this->config->has( 'dcc_enabled' ) && $this->config->get( 'dcc_enabled' ) ) {
$this->supports = array(
'refunds',
'products',
'subscriptions',
'subscription_cancellation',
'subscription_suspension',
'subscription_reactivation',
'subscription_amount_changes',
'subscription_date_changes',
'subscription_payment_method_change',
'subscription_payment_method_change_customer',
'subscription_payment_method_change_admin',
'multiple_subscriptions',
);
if ( $this->config->has( 'vault_enabled_dcc' ) && $this->config->get( 'vault_enabled_dcc' ) ) {
array_push(
$this->supports,
'subscriptions',
'subscription_cancellation',
'subscription_suspension',
'subscription_reactivation',
'subscription_amount_changes',
'subscription_date_changes',
'subscription_payment_method_change',
'subscription_payment_method_change_customer',
'subscription_payment_method_change_admin',
'multiple_subscriptions'
);
}
}
$this->method_title = __(