mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
♻️ Refactor the Fastlane UK feature flag to a separate service
This commit is contained in:
parent
9d2cbdbe51
commit
e5cd2b30ec
1 changed files with 16 additions and 25 deletions
|
@ -167,21 +167,9 @@ return array(
|
|||
),
|
||||
);
|
||||
|
||||
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
/**
|
||||
* Filter to determine if Fastlane UK with 3D Secure should be enabled.
|
||||
*
|
||||
* @param bool $enabled Whether Fastlane UK is enabled.
|
||||
*/
|
||||
if ( apply_filters(
|
||||
'woocommerce.feature-flags.woocommerce_paypal_payments.axo_uk_enabled',
|
||||
getenv( 'PCP_AXO_UK_ENABLED' ) !== '0'
|
||||
) ) {
|
||||
$matrix['GB'] = array(
|
||||
'GBP',
|
||||
);
|
||||
if ( $container->get( 'axo.uk.enabled' ) ) {
|
||||
$matrix['GB'] = array( 'GBP' );
|
||||
}
|
||||
// phpcs:enable WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
|
||||
/**
|
||||
* Returns which countries and currency combinations can be used for AXO.
|
||||
|
@ -210,16 +198,7 @@ return array(
|
|||
),
|
||||
);
|
||||
|
||||
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
/**
|
||||
* Filter to determine if Fastlane UK with 3D Secure should be enabled.
|
||||
*
|
||||
* @param bool $enabled Whether Fastlane UK is enabled.
|
||||
*/
|
||||
if ( apply_filters(
|
||||
'woocommerce.feature-flags.woocommerce_paypal_payments.axo_uk_enabled',
|
||||
getenv( 'PCP_AXO_UK_ENABLED' ) !== '0'
|
||||
) ) {
|
||||
if ( $container->get( 'axo.uk.enabled' ) ) {
|
||||
$matrix['GB'] = array(
|
||||
'VISA',
|
||||
'MASTERCARD',
|
||||
|
@ -227,7 +206,6 @@ return array(
|
|||
'DISCOVER',
|
||||
);
|
||||
}
|
||||
// phpcs:enable WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
|
||||
/**
|
||||
* Returns which countries and card type combinations can be used for AXO.
|
||||
|
@ -418,4 +396,17 @@ return array(
|
|||
)
|
||||
);
|
||||
},
|
||||
'axo.uk.enabled' => static function ( ContainerInterface $container ): bool {
|
||||
// phpcs:disable WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
/**
|
||||
* Filter to determine if Fastlane UK with 3D Secure should be enabled.
|
||||
*
|
||||
* @param bool $enabled Whether Fastlane UK is enabled.
|
||||
*/
|
||||
return apply_filters(
|
||||
'woocommerce.feature-flags.woocommerce_paypal_payments.axo_uk_enabled',
|
||||
getenv( 'PCP_AXO_UK_ENABLED' ) !== '0'
|
||||
);
|
||||
// phpcs:enable WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
},
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue