Skip to content

Commit a65670d

Browse files
authored
Removing deprecated legacy checkout settings methods (#4865)
1 parent 13ca3d1 commit a65670d

File tree

3 files changed

+2
-87
lines changed

3 files changed

+2
-87
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.3.0 - xxxx-xx-xx =
4+
* Dev - Removes deprecated legacy checkout settings retrieval methods
45
* Dev - Removes all references to the UPE-enabled feature flag
56
* Dev - Removes deprecated promotional banners (related to legacy checkout)
67
* Fix - Error when using Puerto Rico addresses with express checkouts

includes/class-wc-stripe-helper.php

Lines changed: 0 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -628,93 +628,6 @@ public static function get_legacy_enabled_payment_method_ids() {
628628
return array_merge( $enabled_payment_method_ids, $mapped_enabled_payment_method_ids );
629629
}
630630

631-
/**
632-
* Get settings of individual legacy payment methods.
633-
*
634-
* @return array
635-
*
636-
* @deprecated 9.6.0 The customization of individual payment methods is now deprecated.
637-
*/
638-
public static function get_legacy_individual_payment_method_settings() {
639-
$stripe_settings = self::get_stripe_settings();
640-
$payment_methods = self::get_legacy_payment_methods();
641-
642-
$payment_method_settings = [
643-
WC_Stripe_Payment_Methods::CARD => [
644-
'name' => isset( $stripe_settings['title'] ) ? $stripe_settings['title'] : '',
645-
'description' => isset( $stripe_settings['description'] ) ? $stripe_settings['description'] : '',
646-
],
647-
];
648-
649-
foreach ( $payment_methods as $payment_method ) {
650-
$settings = [
651-
'name' => $payment_method->get_option( 'title' ),
652-
'description' => $payment_method->get_option( 'description' ),
653-
];
654-
655-
$unique_settings = $payment_method->get_unique_settings();
656-
if ( isset( $unique_settings[ $payment_method->id . '_expiration' ] ) ) {
657-
$settings['expiration'] = $unique_settings[ $payment_method->id . '_expiration' ];
658-
}
659-
660-
$payment_method_id = str_replace( 'stripe_', '', $payment_method->id );
661-
662-
$payment_method_settings[ $payment_method_id ] = $settings;
663-
}
664-
665-
return $payment_method_settings;
666-
}
667-
668-
/**
669-
* Get settings of individual upe payment methods.
670-
*
671-
* @param WC_Stripe_Payment_Gateway $gateway Stripe payment gateway.
672-
* @return array
673-
*
674-
* @deprecated 9.6.0 The customization of individual payment methods is now deprecated.
675-
*/
676-
public static function get_upe_individual_payment_method_settings( $gateway ) {
677-
$payment_method_settings = [];
678-
$available_gateways = $gateway->get_upe_available_payment_methods();
679-
680-
foreach ( $available_gateways as $gateway ) {
681-
$individual_gateway_settings = get_option( 'woocommerce_stripe_' . $gateway . '_settings', [] );
682-
683-
$settings = [
684-
'name' => isset( $individual_gateway_settings['title'] ) ? $individual_gateway_settings['title'] : '',
685-
'description' => isset( $individual_gateway_settings['description'] ) ? $individual_gateway_settings['description'] : '',
686-
];
687-
688-
if ( in_array( $gateway, [ WC_Stripe_Payment_Methods::BOLETO ], true ) ) {
689-
$settings['expiration'] = isset( $individual_gateway_settings['expiration'] ) ? $individual_gateway_settings['expiration'] : '';
690-
}
691-
692-
$payment_method_settings[ $gateway ] = $settings;
693-
}
694-
695-
// If card settings are not set, get it from the default Stripe settings which might be set before enabling UPE.
696-
if ( ! isset( $payment_method_settings['card']['title'] ) && ! isset( $payment_method_settings['card']['description'] ) ) {
697-
$stripe_settings = self::get_stripe_settings();
698-
$title = isset( $stripe_settings['title'] ) ? $stripe_settings['title'] : '';
699-
$description = isset( $stripe_settings['description'] ) ? $stripe_settings['description'] : '';
700-
701-
$payment_method_settings['card'] = [
702-
'name' => $title,
703-
'description' => $description,
704-
];
705-
// Save the title and description to the card settings option.
706-
update_option(
707-
'woocommerce_stripe_card_settings',
708-
[
709-
'title' => $title,
710-
'description' => $description,
711-
]
712-
);
713-
}
714-
715-
return $payment_method_settings;
716-
}
717-
718631
/**
719632
* Returns the list of ordered payment methods for the settings page when UPE is enabled.
720633
* It returns the order saved in the `stripe_upe_payment_method_order` option in Stripe settings.

readme.txt

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

142142
= 10.3.0 - xxxx-xx-xx =
143+
* Dev - Removes deprecated legacy checkout settings retrieval methods
143144
* Fix - Error when using Puerto Rico addresses with express checkouts
144145
* Dev - Removes all references to the UPE-enabled feature flag
145146
* Dev - Removes deprecated promotional banners (related to legacy checkout)

0 commit comments

Comments
 (0)