Add UK and GBP to the Fastlane country/currency supported matrix (behind a feature flag)

This commit is contained in:
Daniel Dudzic 2025-04-16 12:01:23 +02:00
parent bd230ec4df
commit 9d2cbdbe51
No known key found for this signature in database
GPG key ID: 31B40D33E3465483

View file

@ -156,46 +156,85 @@ return array(
* The matrix which countries and currency combinations can be used for AXO.
*/
'axo.supported-country-currency-matrix' => static function ( ContainerInterface $container ) : array {
$matrix = array(
'US' => array(
'AUD',
'CAD',
'EUR',
'GBP',
'JPY',
'USD',
),
);
// 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',
);
}
// phpcs:enable WordPress.NamingConventions.ValidHookName.UseUnderscores
/**
* Returns which countries and currency combinations can be used for AXO.
*/
return apply_filters(
'woocommerce_paypal_payments_axo_supported_country_currency_matrix',
array(
'US' => array(
'AUD',
'CAD',
'EUR',
'GBP',
'JPY',
'USD',
),
)
$matrix
);
},
/**
* The matrix which countries and card type combinations can be used for AXO.
*/
'axo.supported-country-card-type-matrix' => static function ( ContainerInterface $container ) : array {
$matrix = array(
'US' => array(
'VISA',
'MASTERCARD',
'AMEX',
'DISCOVER',
),
'CA' => array(
'VISA',
'MASTERCARD',
'AMEX',
'DISCOVER',
),
);
// 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(
'VISA',
'MASTERCARD',
'AMEX',
'DISCOVER',
);
}
// phpcs:enable WordPress.NamingConventions.ValidHookName.UseUnderscores
/**
* Returns which countries and card type combinations can be used for AXO.
*/
return apply_filters(
'woocommerce_paypal_payments_axo_supported_country_card_type_matrix',
array(
'US' => array(
'VISA',
'MASTERCARD',
'AMEX',
'DISCOVER',
),
'CA' => array(
'VISA',
'MASTERCARD',
'AMEX',
'DISCOVER',
),
)
$matrix
);
},
'axo.settings-conflict-notice' => static function ( ContainerInterface $container ) : string {