Skip to content

Commit 3ed0f68

Browse files
wjrosadaledupreez
andauthored
Hardcoding ECE feature flag to be always enabled (#4710)
* Hardcoding ECE feature flag to be always enabled * Fix comment * Update changelog.txt Co-authored-by: daledupreez <[email protected]> * Readme entry update --------- Co-authored-by: daledupreez <[email protected]>
1 parent 2b9afcd commit 3ed0f68

File tree

4 files changed

+15
-17
lines changed

4 files changed

+15
-17
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Changelog ***
22

33
= 10.0.0 - xxxx-xx-xx =
4+
* Update - Disable Payment Request Buttons and ensure Express Checkout is used when express checkout buttons are enabled
45
* Dev - Expands the Stripe Order Helper class to handle source ID, refund ID, intent ID, and setup intent ID metas
56
* Update - Removing the `wc_stripe_is_upe_checkout_enabled` filter, as Legacy Checkout is no longer supported
67
* Dev - Upgrades `jest` to version 29.7.0, `@wordpress/scripts` to 26.19.0, and adds `axios`(version 1.12.2) to the JavaScript development dependencies

includes/class-wc-stripe-feature-flags.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,18 @@
55

66
class WC_Stripe_Feature_Flags {
77
const UPE_CHECKOUT_FEATURE_ATTRIBUTE_NAME = 'upe_checkout_experience_enabled';
8-
const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece';
98
const AMAZON_PAY_FEATURE_FLAG_NAME = '_wcstripe_feature_amazon_pay';
109

10+
/**
11+
* Feature flag for Stripe ECE (Express Checkout Element).
12+
* This feature flag controls whether the new Express Checkout Element (ECE) or the legacy Payment Request Button (PRB) is used to render express checkout buttons.
13+
*
14+
* @var string
15+
*
16+
* @deprecated This feature flag will be removed in version 10.1.0. ECE will be permanently enabled.
17+
*/
18+
const ECE_FEATURE_FLAG_NAME = '_wcstripe_feature_ece';
19+
1120
/**
1221
* Feature flag for Optimized Checkout (OC).
1322
*
@@ -25,7 +34,6 @@ class WC_Stripe_Feature_Flags {
2534
*/
2635
protected static $feature_flags = [
2736
'_wcstripe_feature_upe' => 'yes',
28-
self::ECE_FEATURE_FLAG_NAME => 'yes',
2937
self::AMAZON_PAY_FEATURE_FLAG_NAME => 'no',
3038
self::OC_FEATURE_FLAG_NAME => 'no',
3139
];
@@ -65,9 +73,11 @@ public static function is_amazon_pay_available() {
6573
* Express checkout buttons are rendered with either ECE or PRB depending on this feature flag.
6674
*
6775
* @return bool
76+
*
77+
* @deprecated 10.0.0 ECE is always enabled. This method will be removed in a future release.
6878
*/
6979
public static function is_stripe_ece_enabled() {
70-
return 'yes' === self::get_option_with_default( self::ECE_FEATURE_FLAG_NAME );
80+
return true;
7181
}
7282

7383
/**

includes/connect/class-wc-stripe-connect.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,6 @@ private function save_stripe_keys( $result, $type = 'connect', $mode = 'live' )
177177
unset( $options['account_id'] );
178178
unset( $options['test_account_id'] );
179179

180-
// Enable ECE for new connections.
181-
$this->enable_ece_in_new_accounts();
182-
183180
WC_Stripe_Database_Cache::delete( WC_Stripe_API::INVALID_API_KEY_ERROR_COUNT_CACHE_KEY );
184181
WC_Stripe_Helper::update_main_stripe_settings( $options );
185182

@@ -232,17 +229,6 @@ private function get_upe_checkout_experience_enabled() {
232229
return 'yes';
233230
}
234231

235-
/**
236-
* Enable Stripe express checkout element for new connections.
237-
*/
238-
private function enable_ece_in_new_accounts() {
239-
$existing_stripe_settings = WC_Stripe_Helper::get_stripe_settings();
240-
241-
if ( empty( $existing_stripe_settings ) ) {
242-
update_option( WC_Stripe_Feature_Flags::ECE_FEATURE_FLAG_NAME, 'yes' );
243-
}
244-
}
245-
246232
/**
247233
* Gets default Stripe settings
248234
*/

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
111111
== Changelog ==
112112

113113
= 10.0.0 - xxxx-xx-xx =
114+
* Update - Disable Payment Request Buttons and ensure Express Checkout is used when express checkout buttons are enabled
114115
* Dev - Expands the Stripe Order Helper class to handle source ID, refund ID, intent ID, and setup intent ID metas
115116
* Update - Removing the `wc_stripe_is_upe_checkout_enabled` filter, as Legacy Checkout is no longer supported
116117
* Dev - Upgrades `jest` to version 29.7.0, `@wordpress/scripts` to 26.19.0, and adds `axios`(version 1.12.2) to the JavaScript development dependencies

0 commit comments

Comments
 (0)