Declare tokenization for ACDC only when vaulting enabled

This commit is contained in:
Alex P. 2024-09-11 10:08:35 +03:00
parent f51dbfc6d3
commit 1f17989723
No known key found for this signature in database
GPG key ID: 54487A734A204D71
2 changed files with 2 additions and 3 deletions

View file

@ -417,13 +417,14 @@ class SavePaymentMethodsModule implements ServiceModule, ExtendingModule, Execut
);
add_filter(
'woocommerce_paypal_payments_credit_card_gateway_vault_supports',
'woocommerce_paypal_payments_credit_card_gateway_supports',
function( array $supports ) use ( $c ): array {
$settings = $c->get( 'wcgateway.settings' );
assert( $settings instanceof ContainerInterface );
if ( $settings->has( 'vault_enabled_dcc' ) && $settings->get( 'vault_enabled_dcc' ) ) {
$supports[] = 'tokenization';
$supports[] = 'add_payment_method';
}
return $supports;