Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
18f5bd6
Removing legacy payment method classes
wjrosa Oct 26, 2025
953521e
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
wjrosa Nov 12, 2025
a9a385c
Changelog and readme entries
wjrosa Nov 12, 2025
d29fe9f
Removing references to legacy methods
wjrosa Nov 12, 2025
ff70ab0
Fix tests
wjrosa Nov 12, 2025
61382ac
Removing implementation of unused methods
wjrosa Nov 12, 2025
d8d60b9
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
daledupreez Nov 14, 2025
b1c4485
Update includes/admin/class-wc-stripe-admin-notices.php
wjrosa Nov 14, 2025
5aeb669
Update includes/class-wc-stripe-helper.php
wjrosa Nov 14, 2025
d1f0261
Update includes/class-wc-stripe-helper.php
wjrosa Nov 14, 2025
4f5f93e
Update includes/class-wc-stripe-helper.php
wjrosa Nov 14, 2025
c50b07a
Update includes/class-wc-stripe-helper.php
wjrosa Nov 14, 2025
da98648
Update includes/class-wc-stripe-helper.php
wjrosa Nov 14, 2025
8ad84cd
Update includes/class-wc-stripe-helper.php
wjrosa Nov 14, 2025
f45297b
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
wjrosa Nov 14, 2025
953f466
Update includes/class-wc-stripe-helper.php
wjrosa Nov 14, 2025
c8715f2
Update includes/admin/class-wc-rest-stripe-settings-controller.php
wjrosa Nov 14, 2025
299ff49
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
wjrosa Nov 19, 2025
c3fa27b
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
daledupreez Nov 21, 2025
5ed4bd0
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
wjrosa Nov 28, 2025
5ce85ab
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
wjrosa Dec 1, 2025
a9d22d1
Update includes/class-wc-stripe-helper.php
wjrosa Dec 1, 2025
93d94ce
Merge branch 'develop' into dev/removing-legacy-payment-method-classes
wjrosa Dec 3, 2025
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
1 change: 1 addition & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*** Changelog ***

= 10.2.0 - xxxx-xx-xx =
* Dev - Removes legacy checkout payment method classes
* Dev - Deprecates all the legacy checkout payment method classes
* Dev - Deprecates all the LPM class constants
* Dev - Remove all references to the UPE-enabled feature flag
Expand Down
2 changes: 1 addition & 1 deletion includes/abstracts/abstract-wc-stripe-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -2171,7 +2171,7 @@ public function payment_scripts() {
}

// Bail if no Stripe payment method is enabled.
if ( 'no' === $this->enabled && empty( WC_Stripe_Helper::get_legacy_enabled_payment_methods() ) ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: should we be queuing these scripts for any pages when UPE is enabled?

if ( 'no' === $this->enabled ) {
return;
}

Expand Down
16 changes: 2 additions & 14 deletions includes/admin/class-wc-rest-stripe-account-keys-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -292,20 +292,8 @@ public function set_account_keys( WP_REST_Request $request ) {
|| $current_account_keys['test_publishable_key'] !== $settings['test_publishable_key']
|| $current_account_keys['test_secret_key'] !== $settings['test_secret_key'] ) {

$is_upe_enabled = 'yes' === $settings[ WC_Stripe_Feature_Flags::UPE_CHECKOUT_FEATURE_ATTRIBUTE_NAME ];
if ( ! $is_upe_enabled ) {
$payment_gateways = WC_Stripe_Helper::get_legacy_payment_methods();
foreach ( $payment_gateways as $gateway ) {
$gateway->update_option( 'enabled', 'no' );
}
} else {
$upe_gateway = new WC_Stripe_UPE_Payment_Gateway();
$upe_gateway->update_enabled_payment_methods( [ WC_Stripe_Payment_Methods::CARD, WC_Stripe_Payment_Methods::LINK ] );

// Handle Multibanco separately as it is a non UPE method but it is part of the same settings page.
$multibanco = WC_Stripe_Helper::get_legacy_payment_method( 'stripe_multibanco' );
$multibanco->update_option( 'enabled', 'no' );
}
$upe_gateway = new WC_Stripe_UPE_Payment_Gateway();
$upe_gateway->update_enabled_payment_methods( [ WC_Stripe_Payment_Methods::CARD, WC_Stripe_Payment_Methods::LINK ] );
}

$this->account->clear_cache();
Expand Down
24 changes: 3 additions & 21 deletions includes/admin/class-wc-rest-stripe-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function register_routes() {
'type' => 'array',
'items' => [
'type' => 'string',
'enum' => array_merge( $this->gateway->get_upe_available_payment_methods(), WC_Stripe_Helper::get_legacy_available_payment_method_ids() ),
'enum' => $this->gateway->get_upe_available_payment_methods(),
],
'validate_callback' => 'rest_validate_request_arg',
],
Expand Down Expand Up @@ -185,7 +185,7 @@ public function register_routes() {
'type' => 'array',
'items' => [
'type' => 'string',
'enum' => array_merge( $this->gateway->get_upe_available_payment_methods(), WC_Stripe_Helper::get_legacy_available_payment_method_ids() ),
'enum' => $this->gateway->get_upe_available_payment_methods(),
],
'validate_callback' => 'rest_validate_request_arg',
],
Expand Down Expand Up @@ -589,25 +589,7 @@ private function update_enabled_payment_methods( $payment_method_ids_to_enable,
return;
}

if ( ! $is_upe_enabled ) {
$currently_enabled_payment_method_ids = WC_Stripe_Helper::get_legacy_enabled_payment_method_ids();
$payment_gateways = WC_Stripe_Helper::get_legacy_payment_methods();

foreach ( $payment_gateways as $gateway ) {
$gateway_id = str_replace( 'stripe_', '', $gateway->id );
if ( ! in_array( $gateway_id, $payment_method_ids_to_enable, true ) && in_array( $gateway_id, $currently_enabled_payment_method_ids, true ) ) {
$gateway->update_option( 'enabled', 'no' );
} elseif ( in_array( $gateway_id, $payment_method_ids_to_enable, true ) ) {
$gateway->update_option( 'enabled', 'yes' );
}
}

return;
}

if ( $this->gateway instanceof WC_Stripe_UPE_Payment_Gateway ) {
$this->gateway->update_enabled_payment_methods( $payment_method_ids_to_enable );
}
$this->gateway->update_enabled_payment_methods( $payment_method_ids_to_enable );
}

/**
Expand Down
16 changes: 3 additions & 13 deletions includes/admin/class-wc-stripe-admin-notices.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,21 +135,11 @@ public static function display_legacy_deprecation_notice( $plugin_file ) {
*
* @since 4.1.0
* @return array
*
* @deprecated 10.2.0 This method will be removed in a future release.
*/
public function get_payment_methods() {
return [
WC_Stripe_Payment_Methods::ALIPAY => WC_Gateway_Stripe_Alipay::class,
WC_Stripe_Payment_Methods::BANCONTACT => WC_Gateway_Stripe_Bancontact::class,
WC_Stripe_Payment_Methods::EPS => WC_Gateway_Stripe_Eps::class,
WC_Stripe_Payment_Methods::GIROPAY => WC_Gateway_Stripe_Giropay::class,
WC_Stripe_Payment_Methods::IDEAL => WC_Gateway_Stripe_Ideal::class,
WC_Stripe_Payment_Methods::MULTIBANCO => WC_Gateway_Stripe_Multibanco::class,
WC_Stripe_Payment_Methods::P24 => WC_Gateway_Stripe_P24::class,
WC_Stripe_Payment_Methods::SEPA => WC_Gateway_Stripe_Sepa::class,
WC_Stripe_Payment_Methods::SOFORT => WC_Gateway_Stripe_Sofort::class,
WC_Stripe_Payment_Methods::BOLETO => WC_Gateway_Stripe_Boleto::class,
WC_Stripe_Payment_Methods::OXXO => WC_Gateway_Stripe_Oxxo::class,
];
return [];
}

/**
Expand Down
12 changes: 0 additions & 12 deletions includes/admin/class-wc-stripe-settings-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,18 +319,6 @@ public static function hide_gateways_on_settings_page() {
$gateways_to_hide = [
// Hide all UPE payment methods.
WC_Stripe_UPE_Payment_Method::class,
// Hide all legacy payment methods.
WC_Gateway_Stripe_Alipay::class,
WC_Gateway_Stripe_Sepa::class,
WC_Gateway_Stripe_Giropay::class,
WC_Gateway_Stripe_Ideal::class,
WC_Gateway_Stripe_Bancontact::class,
WC_Gateway_Stripe_Eps::class,
WC_Gateway_Stripe_P24::class,
WC_Gateway_Stripe_Boleto::class,
WC_Gateway_Stripe_Oxxo::class,
WC_Gateway_Stripe_Sofort::class,
WC_Gateway_Stripe_Multibanco::class,
];

foreach ( WC()->payment_gateways->payment_gateways as $index => $payment_gateway ) {
Expand Down
49 changes: 0 additions & 49 deletions includes/admin/stripe-alipay-settings.php

This file was deleted.

49 changes: 0 additions & 49 deletions includes/admin/stripe-bancontact-settings.php

This file was deleted.

57 changes: 0 additions & 57 deletions includes/admin/stripe-boleto-settings.php

This file was deleted.

47 changes: 0 additions & 47 deletions includes/admin/stripe-eps-settings.php

This file was deleted.

49 changes: 0 additions & 49 deletions includes/admin/stripe-giropay-settings.php

This file was deleted.

Loading
Loading