Skip to content

Commit

Permalink
Add Bacs LPM feature flag (#3754)
Browse files Browse the repository at this point in the history
  • Loading branch information
asumaran authored Jan 22, 2025
1 parent 6a8266b commit 2c8a56f
Show file tree
Hide file tree
Showing 3 changed files with 16 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 @@ -182,6 +182,7 @@ public function admin_scripts( $hook_suffix ) {
'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(),
'is_bacs_enabled' => WC_Stripe_Feature_Flags::is_bacs_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
13 changes: 12 additions & 1 deletion includes/class-wc-stripe-feature-flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ class WC_Stripe_Feature_Flags {
const UPE_CHECKOUT_FEATURE_ATTRIBUTE_NAME = 'upe_checkout_experience_enabled';
const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece';

const LPM_ACH_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_ach';
const LPM_ACH_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_ach';
const LPM_BACS_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_bacs';

/**
* Checks whether ACH LPM (Local Payment Method) feature flag is enabled.
Expand All @@ -19,6 +20,16 @@ public static function is_ach_lpm_enabled() {
return 'yes' === get_option( self::LPM_ACH_FEATURE_FLAG_NAME, 'no' );
}

/**
* Checks whether Bacs LPM (Local Payment Method) feature flag is enabled.
* Alows the merchant to enable/disable Bacs payment method.
*
* @return bool
*/
public static function is_bacs_lpm_enabled(): bool {
return 'yes' === get_option( self::LPM_BACS_FEATURE_FLAG_NAME, 'no' );
}

/**
* Checks whether Stripe ECE (Express Checkout Element) feature flag is enabled.
* Express checkout buttons are rendered with either ECE or PRB depending on this feature flag.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ public function javascript_params() {
// ACH LPM Feature flag.
$stripe_params['is_ach_enabled'] = WC_Stripe_Feature_Flags::is_ach_lpm_enabled();

// Bacs LPM Feature flag.
$stripe_params['is_bacs_enabled'] = WC_Stripe_Feature_Flags::is_bacs_lpm_enabled();

$cart_total = ( WC()->cart ? WC()->cart->get_total( '' ) : 0 );
$currency = get_woocommerce_currency();

Expand Down

0 comments on commit 2c8a56f

Please sign in to comment.