Skip to content

Remove BECS feature flag #4198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 10 additions & 16 deletions client/payment-methods-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ const accountCountry =
const isAchEnabled = window.wc_stripe_settings_params?.is_ach_enabled === '1';
const isAcssEnabled = window.wc_stripe_settings_params?.is_acss_enabled === '1';
const isBacsEnabled = window.wc_stripe_settings_params?.is_bacs_enabled === '1';
const isBecsDebitEnabled =
window.wc_stripe_settings_params?.is_becs_debit_enabled === '1';
const isBlikEnabled = window.wc_stripe_settings_params?.is_blik_enabled === '1';

const paymentMethodsMap = {
Expand Down Expand Up @@ -269,6 +267,16 @@ const paymentMethodsMap = {
currencies: [ 'USD' ],
capability: 'cashapp_payments',
},
au_becs_debit: {
id: PAYMENT_METHOD_BECS,
label: __( 'BECS Direct Debit', 'woocommerce-gateway-stripe' ),
description: __(
'Australia BECS Direct Debit enables your store to accept payments from customers with an Australian bank account.',
'woocommerce-gateway-stripe'
),
Icon: icons.au_becs_debit,
currencies: [ 'AUD' ],
},
};

// Enable ACH according to feature flag value.
Expand Down Expand Up @@ -313,20 +321,6 @@ if ( isBacsEnabled ) {
};
}

// Enable BECS Debit according to feature flag value.
if ( isBecsDebitEnabled ) {
paymentMethodsMap.au_becs_debit = {
id: PAYMENT_METHOD_BECS,
label: __( 'BECS Direct Debit', 'woocommerce-gateway-stripe' ),
description: __(
'Australia BECS Direct Debit enables your store to accept payments from customers with an Australian bank account.',
'woocommerce-gateway-stripe'
),
Icon: icons.au_becs_debit,
currencies: [ 'AUD' ],
};
}

// Enable BLIK according to feature flag value.
if ( isBlikEnabled ) {
paymentMethodsMap.blik = {
Expand Down
1 change: 0 additions & 1 deletion includes/admin/class-wc-stripe-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ public function admin_scripts( $hook_suffix ) {
'is_acss_enabled' => WC_Stripe_Feature_Flags::is_acss_lpm_enabled(),
'is_bacs_enabled' => WC_Stripe_Feature_Flags::is_bacs_lpm_enabled(),
'is_blik_enabled' => WC_Stripe_Feature_Flags::is_blik_lpm_enabled(),
'is_becs_debit_enabled' => WC_Stripe_Feature_Flags::is_becs_debit_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
12 changes: 0 additions & 12 deletions includes/class-wc-stripe-feature-flags.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class WC_Stripe_Feature_Flags {
const LPM_ACSS_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_acss';
const LPM_BACS_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_bacs';
const LPM_BLIK_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_blik';
const LPM_BECS_DEBIT_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_becs_debit';

/**
* Map of feature flag option names => their default "yes"/"no" value.
Expand All @@ -28,7 +27,6 @@ class WC_Stripe_Feature_Flags {
self::LPM_ACH_FEATURE_FLAG_NAME => 'yes',
self::LPM_ACSS_FEATURE_FLAG_NAME => 'yes',
self::LPM_BACS_FEATURE_FLAG_NAME => 'yes',
self::LPM_BECS_DEBIT_FEATURE_FLAG_NAME => 'yes',
self::LPM_BLIK_FEATURE_FLAG_NAME => 'yes',
];

Expand Down Expand Up @@ -102,16 +100,6 @@ public static function is_blik_lpm_enabled(): bool {
return 'yes' === self::get_option_with_default( self::LPM_BLIK_FEATURE_FLAG_NAME );
}

/**
* Checks whether BECS Debit LPM (Local Payment Method) feature flag is enabled.
* https://docs.stripe.com/payments/au-becs-debit.
*
* @return bool
*/
public static function is_becs_debit_lpm_enabled(): bool {
return 'yes' === self::get_option_with_default( self::LPM_BECS_DEBIT_FEATURE_FLAG_NAME );
}

/**
* 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 @@ -193,11 +193,6 @@ public function __construct() {
continue;
}

// Show BECS Debit only if feature is enabled.
if ( WC_Stripe_UPE_Payment_Method_Becs_Debit::class === $payment_method_class && ! WC_Stripe_Feature_Flags::is_becs_debit_lpm_enabled() ) {
continue;
}

// Show BLIK only if feature is enabled.
if ( WC_Stripe_UPE_Payment_Method_BLIK::class === $payment_method_class && ! WC_Stripe_Feature_Flags::is_blik_lpm_enabled() ) {
continue;
Expand Down Expand Up @@ -493,9 +488,6 @@ public function javascript_params() {
// BLIK LPM Feature flag.
$stripe_params['is_blik_enabled'] = WC_Stripe_Feature_Flags::is_blik_lpm_enabled();

// BECS Debit LPM Feature flag.
$stripe_params['is_becs_debit_enabled'] = WC_Stripe_Feature_Flags::is_becs_debit_lpm_enabled();

// Single Payment Element feature flag + setting.
$stripe_params['isSPEEnabled'] = $this->spe_enabled;

Expand Down
Loading