Skip to content

Commit

Permalink
Merge branch 'develop' into dev/auto-generate-changelog-and-readme-en…
Browse files Browse the repository at this point in the history
…tries2
  • Loading branch information
diegocurbelo authored Jan 21, 2025
2 parents 9903405 + 8eaad0e commit 2365ef2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions includes/admin/class-wc-stripe-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 13 additions & 1 deletion includes/class-wc-stripe-feature-flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 2365ef2

Please sign in to comment.