Add display conditions for applepay, googleplay and fastlane

This commit is contained in:
Emili Castells Guasch 2025-01-24 11:22:24 +01:00
parent dde1a702ea
commit 8cba869d7c

View file

@ -278,22 +278,31 @@ class SettingsModule implements ServiceModule, ExecutableModule {
$applepay_product_status = $container->get( 'applepay.apple-product-status' );
assert( $applepay_product_status instanceof AppleProductStatus );
// Unset BCDC if merchant is eligible for ACDC.
if ( $dcc_product_status->dcc_is_active() ) {
unset( $payment_methods['ppcp-card-button-gateway'] );
}
// Unset Venmo when store location is not United States.
if ( $container->get( 'api.shop.country' ) !== 'US' ) {
unset( $payment_methods['venmo'] );
}
// Unset if not eligible for Google Pay.
if ( ! $googlepay_product_status->is_active() ) {
unset( $payment_methods['ppcp-googlepay'] );
}
// Unset if not eligible for Apple Pay.
if ( ! $applepay_product_status->is_active() ) {
unset( $payment_methods['ppcp-applepay'] );
}
// Unset Fastlane if store location is not United States or merchant is not eligible for ACDC.
if ( $container->get( 'api.shop.country' ) !== 'US' || ! $dcc_product_status->dcc_is_active() ) {
unset( $payment_methods['ppcp-axo-gateway'] );
}
return $payment_methods;
}
);