@@ -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.
0 commit comments