diff --git a/includes/admin/class-wc-stripe-settings-controller.php b/includes/admin/class-wc-stripe-settings-controller.php index f7c45a2f6..61815f96b 100644 --- a/includes/admin/class-wc-stripe-settings-controller.php +++ b/includes/admin/class-wc-stripe-settings-controller.php @@ -181,6 +181,7 @@ public function admin_scripts( $hook_suffix ) { 'time' => time(), 'i18n_out_of_sync' => $message, 'is_upe_checkout_enabled' => WC_Stripe_Feature_Flags::is_upe_checkout_enabled(), + 'is_ach_enabled' => WC_Stripe_Feature_Flags::is_ach_lpm_enabled(), 'stripe_oauth_url' => $oauth_url, 'stripe_test_oauth_url' => $test_oauth_url, 'show_customization_notice' => get_option( 'wc_stripe_show_customization_notice', 'yes' ) === 'yes' ? true : false, diff --git a/includes/class-wc-stripe-feature-flags.php b/includes/class-wc-stripe-feature-flags.php index 2344c2f38..05d50f7fb 100644 --- a/includes/class-wc-stripe-feature-flags.php +++ b/includes/class-wc-stripe-feature-flags.php @@ -5,7 +5,19 @@ class WC_Stripe_Feature_Flags { const UPE_CHECKOUT_FEATURE_ATTRIBUTE_NAME = 'upe_checkout_experience_enabled'; - const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece'; + const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece'; + + const LPM_ACH_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_ach'; + + /** + * Checks whether ACH LPM (Local Payment Method) feature flag is enabled. + * ACH LPM is a feature that allows merchants to enable/disable the ACH payment method. + * + * @return bool + */ + public static function is_ach_lpm_enabled() { + return 'yes' === get_option( self::LPM_ACH_FEATURE_FLAG_NAME, 'no' ); + } /** * Checks whether Stripe ECE (Express Checkout Element) feature flag is enabled. diff --git a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php index 3aa3369d5..ce0a7ab3c 100644 --- a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php +++ b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php @@ -413,6 +413,9 @@ public function javascript_params() { // ECE feature flag $stripe_params['isECEEnabled'] = WC_Stripe_Feature_Flags::is_stripe_ece_enabled(); + // ACH LPM Feature flag. + $stripe_params['is_ach_enabled'] = WC_Stripe_Feature_Flags::is_ach_lpm_enabled(); + $cart_total = ( WC()->cart ? WC()->cart->get_total( '' ) : 0 ); $currency = get_woocommerce_currency();