Skip to content

Commit 1822a5c

Browse files
authored
Removing SPE related code (deprecated name for OC) (#4449)
* Fix OC source of truth * Fix tests * Improving tests * Improving tests * Improving tests * Improving tests * Improving tests * New helper to test OC related methods * Remove unused import * Renaming some variables to keep consistency * Fix tests * Changelog and reame entries * Update changelog.txt * Update readme.txt * Removing SPE related code (deprecated name for OC) * Updating docs
1 parent 4af49d1 commit 1822a5c

File tree

5 files changed

+6
-53
lines changed

5 files changed

+6
-53
lines changed

client/blocks/upe/upe-deferred-intent-creation/payment-processor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ const PaymentProcessor = ( {
333333
} else {
334334
removeCashAppLimitNotice();
335335
}
336-
// Apply single payment element styles if the selected payment method is card and SPE is enabled.
336+
// Apply single payment element styles if the selected payment method is card and OC is enabled.
337337
if ( getBlocksConfiguration()?.isOCEnabled ) {
338338
applyStyles();
339339

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

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ class WC_Stripe_Feature_Flags {
1414
const LPM_BLIK_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_blik';
1515
const LPM_BECS_DEBIT_FEATURE_FLAG_NAME = '_wcstripe_feature_lpm_becs_debit';
1616

17-
/**
18-
* Feature flag to control SPE (Single Payment Element, now OC - Optimized CHeckout) feature availability.
19-
*
20-
* @deprecated since 9.5.0 Use `WC_Stripe_Feature_Flags::OC_FEATURE_FLAG_NAME` instead.
21-
*/
22-
const SPE_FEATURE_FLAG_NAME = '_wcstripe_feature_spe';
23-
2417
/**
2518
* Map of feature flag option names => their default "yes"/"no" value.
2619
* This single source of truth makes it easier to maintain our dev tools.
@@ -176,18 +169,7 @@ public static function are_apms_deprecated() {
176169
}
177170

178171
/**
179-
* Whether the Single Payment Element (SPE) feature flag is enabled.
180-
*
181-
* @return bool
182-
*
183-
* @deprecated since 9.5.0 Use `WC_Stripe_Feature_Flags::OC_FEATURE_FLAG_NAME` instead.
184-
*/
185-
public static function is_spe_available() {
186-
return self::is_oc_available();
187-
}
188-
189-
/**
190-
* Whether the Optimized Checkout (OC, previously known as SPE) feature flag is enabled.
172+
* Whether the Optimized Checkout (OC) feature flag is enabled.
191173
*
192174
* @return bool
193175
*/

includes/payment-methods/class-wc-stripe-upe-payment-gateway.php

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,18 +1966,7 @@ public function is_sepa_tokens_for_other_methods_enabled() {
19661966
}
19671967

19681968
/**
1969-
* Checks if the Single Payment Element setting is enabled.
1970-
*
1971-
* @return bool Whether the Single Payment Element setting is enabled.
1972-
*
1973-
* @deprecated 9.5.0 Use is_oc_enabled() instead.
1974-
*/
1975-
public function is_spe_enabled() {
1976-
return $this->oc_enabled;
1977-
}
1978-
1979-
/**
1980-
* Checks if the Optimized Checkout (previously known as SPE) setting is enabled.
1969+
* Checks if the Optimized Checkout setting is enabled.
19811970
*
19821971
* @return bool Whether the Optimized Checkout setting is enabled.
19831972
*/

includes/payment-methods/class-wc-stripe-upe-payment-method.php

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,32 +113,14 @@ abstract class WC_Stripe_UPE_Payment_Method extends WC_Payment_Gateway {
113113
protected $supports_deferred_intent;
114114

115115
/**
116-
* Whether Single Payment Element is enabled.
117-
*
118-
* @var bool
119-
*
120-
* @deprecated 9.5.0 Use `$oc_enabled` instead.
121-
*/
122-
protected $spe_enabled;
123-
124-
/**
125-
* Whether Optimized Checkout (previously known as SPE) is enabled.
116+
* Whether Optimized Checkout is enabled.
126117
*
127118
* @var bool
128119
*/
129120
protected $oc_enabled;
130121

131122
/**
132-
* The default title for the Single Payment Element.
133-
*
134-
* @var string
135-
*
136-
* @deprecated 9.5.0 Use `$oc_title` instead.
137-
*/
138-
protected $spe_title;
139-
140-
/**
141-
* The default title for the Optimized Checkout element (previously known as SPE).
123+
* The default title for the Optimized Checkout element
142124
*
143125
* @var string
144126
*/

tests/phpunit/PaymentMethods/WC_Stripe_UPE_Payment_Method_Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ public function test_non_card_methods_are_not_available_when_optimized_checkout_
800800
$stripe_settings = WC_Stripe_Helper::get_stripe_settings();
801801
$stripe_settings['single_payment_element'] = 'yes';
802802
WC_Stripe_Helper::update_main_stripe_settings( $stripe_settings );
803-
update_option( WC_Stripe_Feature_Flags::SPE_FEATURE_FLAG_NAME, 'yes' );
803+
update_option( WC_Stripe_Feature_Flags::OC_FEATURE_FLAG_NAME, 'yes' );
804804

805805
$mocked_methods = [
806806
'get_capabilities_response',

0 commit comments

Comments
 (0)