Add real DI services for eligibility checks

The existing “services” are actually configuration flags, but not services
This commit is contained in:
Philipp Stracker 2025-03-25 21:21:44 +01:00
parent 407f33444e
commit f9adf64d03
No known key found for this signature in database
5 changed files with 38 additions and 0 deletions

View file

@ -29,7 +29,14 @@ return array(
return $apm_applies->for_country_currency() && $apm_applies->for_merchant();
},
'axo.eligibility.check' => static function ( ContainerInterface $container ): callable {
$apm_applies = $container->get( 'axo.helpers.apm-applies' );
assert( $apm_applies instanceof ApmApplies );
return static function () use ( $apm_applies ) : bool {
return $apm_applies->for_country_currency() && $apm_applies->for_merchant();
};
},
'axo.helpers.apm-applies' => static function ( ContainerInterface $container ) : ApmApplies {
return new ApmApplies(
$container->get( 'axo.supported-country-currency-matrix' ),