Do not save token id in subscription meta if vault v3 enabled

This commit is contained in:
Emili Castells Guasch 2023-12-21 16:53:24 +01:00
parent 5fe89aa90c
commit eb0afbeef8

View file

@ -90,7 +90,9 @@ class WcSubscriptionsModule implements ModuleInterface {
$payment_token_repository = $c->get( 'vaulting.repository.payment-token' );
$logger = $c->get( 'woocommerce.logger.woocommerce' );
$this->add_payment_token_id( $subscription, $payment_token_repository, $logger );
if ( ! $c->has( 'save-payment-methods.eligible' ) || ! $c->get( 'save-payment-methods.eligible' ) ) {
$this->add_payment_token_id( $subscription, $payment_token_repository, $logger );
}
if ( count( $subscription->get_related_orders() ) === 1 ) {
$parent_order = $subscription->get_parent();