diff --git a/changelog.txt b/changelog.txt index 8da100f1f2..a25100812b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,7 @@ *** Changelog *** = 10.1.0 - xxxx-xx-xx = +* Update - Renames and migrates all Payment Request Buttons settings to Express Checkout * Add - Add a new filter allowing third-party plugins to hook captcha solutions when creating and confirming setup intents * Dev - Add track events when clicking the "Reconnect to Stripe" button (both in the settings page and the admin notice) * Update - Removes unnecessary legacy checkout gateway instantiations and UPE disablement code diff --git a/includes/admin/class-wc-rest-stripe-settings-controller.php b/includes/admin/class-wc-rest-stripe-settings-controller.php index e02906536f..4daa684182 100644 --- a/includes/admin/class-wc-rest-stripe-settings-controller.php +++ b/includes/admin/class-wc-rest-stripe-settings-controller.php @@ -109,20 +109,20 @@ public function register_routes() { 'payment_request_button_type' => [ 'description' => __( 'Express checkout button types.', 'woocommerce-gateway-stripe' ), 'type' => 'string', - 'enum' => array_keys( $form_fields['payment_request_button_type']['options'] ), + 'enum' => array_keys( $form_fields['express_checkout_button_type']['options'] ), 'validate_callback' => 'rest_validate_request_arg', ], 'payment_request_button_theme' => [ 'description' => __( 'Express checkout button themes.', 'woocommerce-gateway-stripe' ), 'type' => 'string', - 'enum' => array_keys( $form_fields['payment_request_button_theme']['options'] ), + 'enum' => array_keys( $form_fields['express_checkout_button_theme']['options'] ), 'validate_callback' => 'rest_validate_request_arg', ], 'payment_request_button_size' => [ 'description' => __( 'Express checkout button sizes.', 'woocommerce-gateway-stripe' ), 'type' => 'string', - // it can happen that `$form_fields['payment_request_button_size']` is empty (in tests) - fixing temporarily. - 'enum' => array_keys( isset( $form_fields['payment_request_button_size']['options'] ) ? $form_fields['payment_request_button_size']['options'] : [] ), + // it can happen that `$form_fields['express_checkout_button_size']` is empty (in tests) - fixing temporarily. + 'enum' => array_keys( isset( $form_fields['express_checkout_button_size']['options'] ) ? $form_fields['express_checkout_button_size']['options'] : [] ), 'validate_callback' => 'rest_validate_request_arg', ], 'payment_request_button_locations' => [ @@ -130,7 +130,7 @@ public function register_routes() { 'type' => 'array', 'items' => [ 'type' => 'string', - 'enum' => array_keys( $form_fields['payment_request_button_locations']['options'] ), + 'enum' => array_keys( $form_fields['express_checkout_button_locations']['options'] ), ], 'validate_callback' => 'rest_validate_request_arg', ], @@ -237,10 +237,10 @@ public function get_settings() { 'amazon_pay_button_size' => $this->gateway->get_validated_option( 'amazon_pay_button_size' ), 'amazon_pay_button_locations' => $this->gateway->get_validated_option( 'amazon_pay_button_locations' ), 'is_payment_request_enabled' => $this->gateway->is_payment_request_enabled(), - 'payment_request_button_type' => $this->gateway->get_validated_option( 'payment_request_button_type' ), - 'payment_request_button_theme' => $this->gateway->get_validated_option( 'payment_request_button_theme' ), - 'payment_request_button_size' => $this->gateway->get_validated_option( 'payment_request_button_size' ), - 'payment_request_button_locations' => $this->gateway->get_validated_option( 'payment_request_button_locations' ), + 'payment_request_button_type' => $this->gateway->get_validated_option( 'express_checkout_button_type' ), + 'payment_request_button_theme' => $this->gateway->get_validated_option( 'express_checkout_button_theme' ), + 'payment_request_button_size' => $this->gateway->get_validated_option( 'express_checkout_button_size' ), + 'payment_request_button_locations' => $this->gateway->get_validated_option( 'express_checkout_button_locations' ), /* Settings > Payments & transactions */ 'is_manual_capture_enabled' => ! $this->gateway->is_automatic_capture_enabled(), @@ -540,10 +540,10 @@ private function update_amazon_pay_settings( WP_REST_Request $request ) { */ private function update_payment_request_settings( WP_REST_Request $request ) { $attributes = [ - 'payment_request_button_type' => 'payment_request_button_type', - 'payment_request_button_size' => 'payment_request_button_size', - 'payment_request_button_theme' => 'payment_request_button_theme', - 'payment_request_button_locations' => 'payment_request_button_locations', + 'payment_request_button_type' => 'express_checkout_button_type', + 'payment_request_button_size' => 'express_checkout_button_size', + 'payment_request_button_theme' => 'express_checkout_button_theme', + 'payment_request_button_locations' => 'express_checkout_button_locations', ]; foreach ( $attributes as $request_key => $attribute ) { diff --git a/includes/admin/class-wc-stripe-inbox-notes.php b/includes/admin/class-wc-stripe-inbox-notes.php index 8542ae4513..12663be822 100644 --- a/includes/admin/class-wc-stripe-inbox-notes.php +++ b/includes/admin/class-wc-stripe-inbox-notes.php @@ -124,7 +124,7 @@ public static function should_show_marketing_note() { // Make sure Apple Pay is enabled and setup is successful. $stripe_settings = WC_Stripe_Helper::get_stripe_settings(); $stripe_enabled = isset( $stripe_settings['enabled'] ) && 'yes' === $stripe_settings['enabled']; - $button_enabled = isset( $stripe_settings['payment_request'] ) && 'yes' === $stripe_settings['payment_request']; + $button_enabled = isset( $stripe_settings['express_checkout'] ) && 'yes' === $stripe_settings['express_checkout']; $registration_complete = isset( $stripe_settings['apple_pay_domain_set'] ) && 'yes' === $stripe_settings['apple_pay_domain_set']; if ( ! $stripe_enabled || ! $button_enabled || ! $registration_complete ) { return false; diff --git a/includes/admin/class-wc-stripe-payment-gateways-controller.php b/includes/admin/class-wc-stripe-payment-gateways-controller.php index 1fbc516612..e9a1b6305e 100644 --- a/includes/admin/class-wc-stripe-payment-gateways-controller.php +++ b/includes/admin/class-wc-stripe-payment-gateways-controller.php @@ -19,7 +19,7 @@ public function __construct() { // If UPE is enabled and there are enabled payment methods, we need to load the disable Stripe confirmation modal. $stripe_settings = WC_Stripe_Helper::get_stripe_settings(); $enabled_upe_payment_methods = WC_Stripe_Payment_Method_Configurations::get_upe_enabled_payment_method_ids(); - $upe_payment_requests_enabled = 'yes' === ( $stripe_settings['payment_request'] ?? 'no' ); + $upe_payment_requests_enabled = 'yes' === ( $stripe_settings['express_checkout'] ?? 'no' ); if ( ( is_array( $enabled_upe_payment_methods ) && count( $enabled_upe_payment_methods ) > 0 ) || $upe_payment_requests_enabled ) { add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_payments_scripts' ] ); diff --git a/includes/admin/stripe-settings.php b/includes/admin/stripe-settings.php index b2ba9ffda3..dc76c8c5a5 100644 --- a/includes/admin/stripe-settings.php +++ b/includes/admin/stripe-settings.php @@ -117,7 +117,7 @@ 'default' => 'yes', 'desc_tip' => true, ], - 'payment_request' => [ + 'express_checkout' => [ 'title' => __( 'Payment Request Buttons', 'woocommerce-gateway-stripe' ), 'label' => sprintf( /* translators: 1) br tag 2) Stripe anchor tag 3) Apple anchor tag 4) Stripe dashboard opening anchor tag 5) Stripe dashboard closing anchor tag */ @@ -133,7 +133,7 @@ 'default' => 'yes', 'desc_tip' => true, ], - 'payment_request_button_type' => [ + 'express_checkout_button_type' => [ 'title' => __( 'Payment Request Button Type', 'woocommerce-gateway-stripe' ), 'label' => __( 'Button Type', 'woocommerce-gateway-stripe' ), 'type' => 'select', @@ -148,7 +148,7 @@ 'custom' => __( 'Custom', 'woocommerce-gateway-stripe' ), ], ], - 'payment_request_button_theme' => [ + 'express_checkout_button_theme' => [ 'title' => __( 'Payment Request Button Theme', 'woocommerce-gateway-stripe' ), 'label' => __( 'Button Theme', 'woocommerce-gateway-stripe' ), 'type' => 'select', @@ -189,7 +189,7 @@ 'long' => __( 'Text and logo', 'woocommerce-gateway-stripe' ), ], ], - 'payment_request_button_locations' => [ + 'express_checkout_button_locations' => [ 'title' => __( 'Payment Request Button Locations', 'woocommerce-gateway-stripe' ), 'type' => 'multiselect', 'description' => __( 'Select where you would like Payment Request Buttons to be displayed', 'woocommerce-gateway-stripe' ), @@ -205,7 +205,7 @@ 'data-placeholder' => __( 'Select pages', 'woocommerce-gateway-stripe' ), ], ], - 'payment_request_button_size' => [ + 'express_checkout_button_size' => [ 'title' => __( 'Payment Request Button Size', 'woocommerce-gateway-stripe' ), 'type' => 'select', 'description' => __( 'Select the size of the button.', 'woocommerce-gateway-stripe' ), @@ -293,20 +293,20 @@ if ( WC_Stripe_Feature_Flags::is_upe_preview_enabled() ) { // in the new settings, "checkout" is going to be enabled by default (if it is a new WCStripe installation). - $stripe_settings['payment_request_button_locations']['default'][] = 'checkout'; + $stripe_settings['express_checkout_button_locations']['default'][] = 'checkout'; // no longer needed in the new settings. - unset( $stripe_settings['payment_request_button_branded_type'] ); - unset( $stripe_settings['payment_request_button_height'] ); - unset( $stripe_settings['payment_request_button_label'] ); + unset( $stripe_settings['express_checkout_button_branded_type'] ); + unset( $stripe_settings['express_checkout_button_height'] ); + unset( $stripe_settings['express_checkout_button_label'] ); // injecting some of the new options. - $stripe_settings['payment_request_button_type']['options']['default'] = __( 'Only icon', 'woocommerce-gateway-stripe' ); - $stripe_settings['payment_request_button_type']['options']['book'] = __( 'Book', 'woocommerce-gateway-stripe' ); + $stripe_settings['express_checkout_button_type']['options']['default'] = __( 'Only icon', 'woocommerce-gateway-stripe' ); + $stripe_settings['express_checkout_button_type']['options']['book'] = __( 'Book', 'woocommerce-gateway-stripe' ); // no longer valid options. - unset( $stripe_settings['payment_request_button_type']['options']['branded'] ); - unset( $stripe_settings['payment_request_button_type']['options']['custom'] ); + unset( $stripe_settings['express_checkout_button_type']['options']['branded'] ); + unset( $stripe_settings['express_checkout_button_type']['options']['custom'] ); } else { - unset( $stripe_settings['payment_request_button_size'] ); + unset( $stripe_settings['express_checkout_button_size'] ); } if ( WC_Stripe_Feature_Flags::is_upe_preview_enabled() ) { diff --git a/includes/class-wc-gateway-stripe.php b/includes/class-wc-gateway-stripe.php index 35f342e4a3..69403d0b6f 100644 --- a/includes/class-wc-gateway-stripe.php +++ b/includes/class-wc-gateway-stripe.php @@ -116,7 +116,7 @@ public function __construct() { $this->saved_cards = 'yes' === $this->get_option( 'saved_cards' ); $this->secret_key = $this->testmode ? $this->get_validated_option( 'test_secret_key' ) : $this->get_validated_option( 'secret_key' ); $this->publishable_key = $this->testmode ? $this->get_validated_option( 'test_publishable_key' ) : $this->get_validated_option( 'publishable_key' ); - $this->payment_request = 'yes' === $this->get_option( 'payment_request', 'yes' ); + $this->payment_request = 'yes' === $this->get_option( 'express_checkout', 'yes' ); WC_Stripe_API::set_secret_key( $this->secret_key ); @@ -1236,7 +1236,7 @@ private function validate_field( $field_key, $field_value ) { * @return bool */ public function is_payment_request_enabled() { - return 'yes' === $this->get_option( 'payment_request' ); + return 'yes' === $this->get_option( 'express_checkout' ); } /** diff --git a/includes/class-wc-stripe-helper.php b/includes/class-wc-stripe-helper.php index 97d56d5024..52e57e5503 100644 --- a/includes/class-wc-stripe-helper.php +++ b/includes/class-wc-stripe-helper.php @@ -1285,8 +1285,8 @@ public static function should_load_scripts_on_cart_page() { private static function should_load_scripts_for_prb_location( $location ) { // Make sure location parameter is sanitized. $location = in_array( $location, [ 'product', 'cart' ], true ) ? $location : ''; - $are_prbs_enabled = self::get_settings( null, 'payment_request' ) ?? 'yes'; - $prb_locations = self::get_settings( null, 'payment_request_button_locations' ) ?? [ 'product', 'cart' ]; + $are_prbs_enabled = self::get_settings( null, 'express_checkout' ) ?? 'yes'; + $prb_locations = self::get_settings( null, 'express_checkout_button_locations' ) ?? [ 'product', 'cart' ]; // The scripts should be loaded when all of the following are true: // 1. The PRBs are enabled; and diff --git a/includes/class-wc-stripe-payment-method-configurations.php b/includes/class-wc-stripe-payment-method-configurations.php index 1facd6d370..7e12203ed3 100644 --- a/includes/class-wc-stripe-payment-method-configurations.php +++ b/includes/class-wc-stripe-payment-method-configurations.php @@ -538,7 +538,7 @@ public static function maybe_migrate_payment_methods_from_db_to_pmc( $force_migr } // Add Google Pay and Apple Pay to the list if payment_request is enabled - if ( ! empty( $stripe_settings['payment_request'] ) && 'yes' === $stripe_settings['payment_request'] ) { + if ( ! empty( $stripe_settings['express_checkout'] ) && 'yes' === $stripe_settings['express_checkout'] ) { $enabled_payment_methods = array_merge( $enabled_payment_methods, [ WC_Stripe_Payment_Methods::GOOGLE_PAY, WC_Stripe_Payment_Methods::APPLE_PAY ] diff --git a/includes/class-wc-stripe.php b/includes/class-wc-stripe.php index 4cae23488c..a92196e66e 100644 --- a/includes/class-wc-stripe.php +++ b/includes/class-wc-stripe.php @@ -217,8 +217,7 @@ public function init() { require_once WC_STRIPE_PLUGIN_PATH . '/includes/class-wc-stripe-account.php'; new Allowed_Payment_Request_Button_Types_Update(); - // TODO: Temporary disabling the migration as it has a conflict with the new UPE checkout. - // new Migrate_Payment_Request_Data_To_Express_Checkout_Data(); + new Migrate_Payment_Request_Data_To_Express_Checkout_Data(); new Sepa_Tokens_For_Other_Methods_Settings_Update(); $this->api = new WC_Stripe_Connect_API(); @@ -415,8 +414,8 @@ public function migrate_to_new_checkout_experience() { */ public function update_prb_location_settings() { $stripe_settings = WC_Stripe_Helper::get_stripe_settings(); - $prb_locations = isset( $stripe_settings['payment_request_button_locations'] ) - ? $stripe_settings['payment_request_button_locations'] + $prb_locations = isset( $stripe_settings['express_checkout_button_locations'] ) + ? $stripe_settings['express_checkout_button_locations'] : []; if ( ! empty( $stripe_settings ) && empty( $prb_locations ) ) { global $post; @@ -439,7 +438,7 @@ public function update_prb_location_settings() { $new_prb_locations[] = 'checkout'; } - $stripe_settings['payment_request_button_locations'] = $new_prb_locations; + $stripe_settings['express_checkout_button_locations'] = $new_prb_locations; WC_Stripe_Helper::update_main_stripe_settings( $stripe_settings ); } } diff --git a/includes/payment-methods/class-wc-stripe-express-checkout-helper.php b/includes/payment-methods/class-wc-stripe-express-checkout-helper.php index b6f826bd9e..170a0e2f77 100644 --- a/includes/payment-methods/class-wc-stripe-express-checkout-helper.php +++ b/includes/payment-methods/class-wc-stripe-express-checkout-helper.php @@ -108,7 +108,7 @@ public function is_account_creation_possible() { * @return string */ public function get_button_type() { - return isset( $this->stripe_settings['payment_request_button_type'] ) ? $this->stripe_settings['payment_request_button_type'] : 'default'; + return isset( $this->stripe_settings['express_checkout_button_type'] ) ? $this->stripe_settings['express_checkout_button_type'] : 'default'; } /** @@ -117,7 +117,7 @@ public function get_button_type() { * @return string */ public function get_button_theme() { - return isset( $this->stripe_settings['payment_request_button_theme'] ) ? $this->stripe_settings['payment_request_button_theme'] : 'dark'; + return isset( $this->stripe_settings['express_checkout_button_theme'] ) ? $this->stripe_settings['express_checkout_button_theme'] : 'dark'; } /** @@ -126,7 +126,7 @@ public function get_button_theme() { * @return string */ public function get_button_height() { - $height = isset( $this->stripe_settings['payment_request_button_size'] ) ? $this->stripe_settings['payment_request_button_size'] : 'default'; + $height = isset( $this->stripe_settings['express_checkout_button_size'] ) ? $this->stripe_settings['express_checkout_button_size'] : 'default'; if ( 'small' === $height ) { return '40'; } @@ -144,7 +144,7 @@ public function get_button_height() { * @return string */ public function get_button_radius() { - $height = isset( $this->stripe_settings['payment_request_button_size'] ) ? $this->stripe_settings['payment_request_button_size'] : 'default'; + $height = isset( $this->stripe_settings['express_checkout_button_size'] ) ? $this->stripe_settings['express_checkout_button_size'] : 'default'; if ( 'small' === $height ) { return '2'; } @@ -1553,18 +1553,18 @@ public function get_login_confirmation_settings() { */ public function get_button_locations() { // If the locations have not been set return the default setting. - if ( ! isset( $this->stripe_settings['payment_request_button_locations'] ) ) { + if ( ! isset( $this->stripe_settings['express_checkout_button_locations'] ) ) { return [ 'product', 'cart' ]; } // If all locations are removed through the settings UI the location config will be set to // an empty string "". If that's the case (and if the settings are not an array for any // other reason) we should return an empty array. - if ( ! is_array( $this->stripe_settings['payment_request_button_locations'] ) ) { + if ( ! is_array( $this->stripe_settings['express_checkout_button_locations'] ) ) { return []; } - return $this->stripe_settings['payment_request_button_locations']; + return $this->stripe_settings['express_checkout_button_locations']; } /** diff --git a/readme.txt b/readme.txt index 7325de95ad..31db5a00f7 100644 --- a/readme.txt +++ b/readme.txt @@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o == Changelog == = 10.1.0 - xxxx-xx-xx = +* Update - Renames and migrates all Payment Request Buttons settings to Express Checkout * Add - Add a new filter allowing third-party plugins to hook captcha solutions when creating and confirming setup intents * Dev - Add track events when clicking the "Reconnect to Stripe" button (both in the settings page and the admin notice) * Update - Removes unnecessary legacy checkout gateway instantiations and UPE disablement code diff --git a/tests/phpunit/Admin/Migrations/Migrate_Payment_Methods_From_DB_To_PMC_Test.php b/tests/phpunit/Admin/Migrations/Migrate_Payment_Methods_From_DB_To_PMC_Test.php index e59a2fba3b..d39f076a88 100644 --- a/tests/phpunit/Admin/Migrations/Migrate_Payment_Methods_From_DB_To_PMC_Test.php +++ b/tests/phpunit/Admin/Migrations/Migrate_Payment_Methods_From_DB_To_PMC_Test.php @@ -53,7 +53,7 @@ public function test_migration_executed_when_pmc_enabled_is_not_set() { // Set pmc_enabled to '' to trigger migration $stripe_settings = WC_Stripe_Helper::get_stripe_settings(); $stripe_settings['test_connection_type'] = 'connect'; - $stripe_settings['payment_request'] = 'yes'; + $stripe_settings['express_checkout'] = 'yes'; $stripe_settings['upe_checkout_experience_accepted_payments'] = [ 'link', 'sepa_debit' ]; $stripe_settings['pmc_enabled'] = ''; WC_Stripe_Helper::update_main_stripe_settings( $stripe_settings ); diff --git a/tests/phpunit/Admin/WC_REST_Stripe_Settings_Controller_Test.php b/tests/phpunit/Admin/WC_REST_Stripe_Settings_Controller_Test.php index be66b40049..9a34088a18 100644 --- a/tests/phpunit/Admin/WC_REST_Stripe_Settings_Controller_Test.php +++ b/tests/phpunit/Admin/WC_REST_Stripe_Settings_Controller_Test.php @@ -183,6 +183,15 @@ public function test_boolean_fields( $rest_key, $option_name, $inverse = false ) } /** + * Tests for enum fields. + * + * @param string $rest_key REST API key. + * @param string $option_name Option name. + * @param string|array $original_valid_value Original valid value. + * @param string|array $new_valid_value New valid value. + * @param string|array $new_invalid_value New invalid value. + * @param bool $is_upe_enabled Whether UPE is enabled. + * * @dataProvider enum_field_provider */ public function test_enum_fields( $rest_key, $option_name, $original_valid_value, $new_valid_value, $new_invalid_value, $is_upe_enabled = true ) { @@ -508,28 +517,6 @@ public function is_payment_request_enabled_provider() { ]; } - /** - * @dataProvider is_payment_request_enabled_legacy_provider - */ - public function test_is_payment_request_enabled_legacy( $is_enabled, $option_value ) { - // Settings controller with non-UPE gateway. - $gateway = new WC_Stripe_UPE_Payment_Gateway(); - $gateway->update_option( 'payment_request', $option_value ); - $controller = new WC_REST_Stripe_Settings_Controller( $gateway ); - - $request = new WP_REST_Request( 'GET', self::SETTINGS_ROUTE ); - $response = $controller->get_settings( $request ); - $this->assertEquals( 200, $response->get_status() ); - $this->assertEquals( $is_enabled, $response->get_data()['is_payment_request_enabled'] ); - } - - public function is_payment_request_enabled_legacy_provider() { - return [ - [ true, 'yes' ], - [ false, 'no' ], - ]; - } - public function boolean_field_provider() { return [ 'is_stripe_enabled' => [ 'is_stripe_enabled', 'enabled' ], @@ -553,32 +540,37 @@ public function stripe_payment_method_configurations_provider() { ]; } + /** + * Data provider for `test_enum_fields`. + * + * @return array + */ public function enum_field_provider() { return [ 'payment_request_button_theme' => [ 'payment_request_button_theme', - 'payment_request_button_theme', + 'express_checkout_button_theme', 'dark', 'light', 'foo', ], 'payment_request_button_size' => [ 'payment_request_button_size', - 'payment_request_button_size', + 'express_checkout_button_size', 'default', 'large', 'foo', ], 'payment_request_button_type' => [ 'payment_request_button_type', - 'payment_request_button_type', + 'express_checkout_button_type', 'buy', 'book', 'foo', ], 'payment_request_button_locations' => [ 'payment_request_button_locations', - 'payment_request_button_locations', + 'express_checkout_button_locations', [ 'cart' ], [ 'cart', 'checkout', 'product' ], [ 'foo' ], diff --git a/tests/phpunit/WC_Stripe_Apple_Pay_Registration_Test.php b/tests/phpunit/WC_Stripe_Apple_Pay_Registration_Test.php index 1be0b9c487..0573946e09 100644 --- a/tests/phpunit/WC_Stripe_Apple_Pay_Registration_Test.php +++ b/tests/phpunit/WC_Stripe_Apple_Pay_Registration_Test.php @@ -55,21 +55,6 @@ public function set_up() { $this->upe_helper = new UPE_Test_Helper(); } - /** - * Disable UPE and enable/disable Apple Pay/Google Pay. - * - * @param bool $payment_request_enabled Whether Apple Pay/Google Pay should be enabled. - */ - private function legacy_checkout_setup( $payment_request_enabled = true ) { - $this->upe_helper->disable_upe(); - $this->upe_helper->reload_payment_gateways(); - - $settings = WC_Stripe_Helper::get_stripe_settings(); - $settings['payment_request'] = $payment_request_enabled ? 'yes' : 'no'; - WC_Stripe_Helper::update_main_stripe_settings( $settings ); - WC_Stripe::get_instance()->get_main_stripe_gateway()->init_settings(); - } - /** * Enable UPE and enable/disable Apple Pay/Google Pay. * @@ -86,20 +71,6 @@ private function upe_checkout_setup( $payment_request_enabled = true ) { } } - public function test_register_domain_if_configured_no_secret_key() { - $this->legacy_checkout_setup( true ); - - $this->mock_wc_apple_pay_registration - ->expects( $this->never() ) - ->method( 'register_domain' ); - - $settings = WC_Stripe_Helper::get_stripe_settings(); - unset( $settings['test_secret_key'] ); - WC_Stripe_Helper::update_main_stripe_settings( $settings ); - - $this->mock_wc_apple_pay_registration->register_domain_if_configured(); - } - public function test_register_domain_if_configured_supported_country() { $this->upe_checkout_setup(); @@ -124,43 +95,6 @@ public function test_register_domain_if_configured_supported_country() { $this->mock_wc_apple_pay_registration->register_domain_if_configured(); } - public function test_register_domain_if_configured_unsupported_country() { - $this->legacy_checkout_setup( true ); - - WC_Stripe::get_instance()->account = $this->getMockBuilder( 'WC_Stripe_Account' ) - ->disableOriginalConstructor() - ->setMethods( - [ - 'get_cached_account_data', - ] - ) - ->getMock(); - - WC_Stripe::get_instance()->account - ->expects( $this->any() ) - ->method( 'get_cached_account_data' ) - ->willReturn( [ 'country' => 'IN' ] ); - - $this->mock_wc_apple_pay_registration - ->expects( $this->never() ) - ->method( 'register_domain' ); - - $this->mock_wc_apple_pay_registration->register_domain_if_configured(); - } - - /** - * Test for when Apple Pay (legacy PRB) are disabled. - */ - public function test_register_domain_if_configured_apple_pay_disabled() { - $this->legacy_checkout_setup( false ); - - $this->mock_wc_apple_pay_registration - ->expects( $this->never() ) - ->method( 'register_domain' ); - - $this->mock_wc_apple_pay_registration->register_domain_if_configured(); - } - /** * Test for UPE, Apple Pay enabled. */