🐛 Fix “use-ACDC” flag in legacy UI

A new filter adds backwards compatibility by overwriting the ACDC decision with a settings choice.
This commit is contained in:
Philipp Stracker 2025-03-18 16:31:38 +01:00
parent 09c4f176d0
commit fb27373c1b
No known key found for this signature in database

View file

@ -508,6 +508,18 @@ class CompatModule implements ServiceModule, ExtendingModule, ExecutableModule {
return;
}
// Add filters here...
add_filter(
'woocommerce_paypal_payments_is_acdc_active',
static function ( bool $is_acdc ) use ( $container ) : bool {
$settings = $container->get( 'wcgateway.settings' );
assert( $settings instanceof Settings );
try {
return (bool) $settings->get( 'dcc_enabled' );
} catch ( NotFoundException $exception ) {
return $is_acdc;
}
}
);
}
}