From b0e929c95c621ebf0b9ad3dae56e1fe074ec192f Mon Sep 17 00:00:00 2001 From: Guilherme Pressutto Date: Fri, 1 Sep 2023 14:49:43 -0300 Subject: [PATCH] Temporarily disable saving SEPA (#7107) --- changelog/temporarily-disable-saving-sepa | 4 ++++ includes/payment-methods/class-sepa-payment-method.php | 2 +- .../unit/payment-methods/test-class-upe-payment-gateway.php | 4 ++-- .../test-class-upe-split-payment-gateway.php | 6 +++--- 4 files changed, 10 insertions(+), 6 deletions(-) create mode 100644 changelog/temporarily-disable-saving-sepa diff --git a/changelog/temporarily-disable-saving-sepa b/changelog/temporarily-disable-saving-sepa new file mode 100644 index 00000000000..53e329f4089 --- /dev/null +++ b/changelog/temporarily-disable-saving-sepa @@ -0,0 +1,4 @@ +Significance: minor +Type: update + +Temporarily disable saving SEPA diff --git a/includes/payment-methods/class-sepa-payment-method.php b/includes/payment-methods/class-sepa-payment-method.php index 76fbadd541d..914363f7710 100644 --- a/includes/payment-methods/class-sepa-payment-method.php +++ b/includes/payment-methods/class-sepa-payment-method.php @@ -25,7 +25,7 @@ public function __construct( $token_service ) { parent::__construct( $token_service ); $this->stripe_id = self::PAYMENT_METHOD_STRIPE_ID; $this->title = 'SEPA Direct Debit'; - $this->is_reusable = true; + $this->is_reusable = false; $this->currencies = [ 'EUR' ]; $this->icon_url = plugins_url( 'assets/images/payment-methods/sepa-debit.svg', WCPAY_PLUGIN_FILE ); } diff --git a/tests/unit/payment-methods/test-class-upe-payment-gateway.php b/tests/unit/payment-methods/test-class-upe-payment-gateway.php index 715a43ff967..e52cac12c1d 100644 --- a/tests/unit/payment-methods/test-class-upe-payment-gateway.php +++ b/tests/unit/payment-methods/test-class-upe-payment-gateway.php @@ -1555,7 +1555,7 @@ public function test_payment_methods_show_correct_default_outputs() { $this->assertEquals( 'SEPA Direct Debit', $sepa_method->get_title() ); $this->assertEquals( 'SEPA Direct Debit', $sepa_method->get_title( $mock_sepa_details ) ); $this->assertTrue( $sepa_method->is_enabled_at_checkout() ); - $this->assertTrue( $sepa_method->is_reusable() ); + $this->assertFalse( $sepa_method->is_reusable() ); $this->assertEquals( 'ideal', $ideal_method->get_id() ); $this->assertEquals( 'iDEAL', $ideal_method->get_title() ); @@ -1602,7 +1602,7 @@ public function test_only_reusabled_payment_methods_enabled_with_subscription_it $this->assertFalse( $sofort_method->is_enabled_at_checkout() ); $this->assertFalse( $bancontact_method->is_enabled_at_checkout() ); $this->assertFalse( $eps_method->is_enabled_at_checkout() ); - $this->assertTrue( $sepa_method->is_enabled_at_checkout() ); + $this->assertFalse( $sepa_method->is_enabled_at_checkout() ); $this->assertFalse( $p24_method->is_enabled_at_checkout() ); $this->assertFalse( $ideal_method->is_enabled_at_checkout() ); $this->assertFalse( $becs_method->is_enabled_at_checkout() ); diff --git a/tests/unit/payment-methods/test-class-upe-split-payment-gateway.php b/tests/unit/payment-methods/test-class-upe-split-payment-gateway.php index 4a613570de1..18c0024bb3e 100644 --- a/tests/unit/payment-methods/test-class-upe-split-payment-gateway.php +++ b/tests/unit/payment-methods/test-class-upe-split-payment-gateway.php @@ -1559,7 +1559,7 @@ public function test_payment_methods_show_correct_default_outputs() { $this->assertEquals( 'SEPA Direct Debit', $sepa_method->get_title() ); $this->assertEquals( 'SEPA Direct Debit', $sepa_method->get_title( $mock_sepa_details ) ); $this->assertTrue( $sepa_method->is_enabled_at_checkout() ); - $this->assertTrue( $sepa_method->is_reusable() ); + $this->assertFalse( $sepa_method->is_reusable() ); $this->assertEquals( 'ideal', $ideal_method->get_id() ); $this->assertEquals( 'iDEAL', $ideal_method->get_title() ); @@ -1594,7 +1594,7 @@ public function test_only_reusabled_payment_methods_enabled_with_subscription_it $this->assertFalse( $sofort_method->is_enabled_at_checkout() ); $this->assertFalse( $bancontact_method->is_enabled_at_checkout() ); $this->assertFalse( $eps_method->is_enabled_at_checkout() ); - $this->assertTrue( $sepa_method->is_enabled_at_checkout() ); + $this->assertFalse( $sepa_method->is_enabled_at_checkout() ); $this->assertFalse( $p24_method->is_enabled_at_checkout() ); $this->assertFalse( $ideal_method->is_enabled_at_checkout() ); $this->assertFalse( $becs_method->is_enabled_at_checkout() ); @@ -2044,7 +2044,7 @@ public function test_save_option_for_sepa_debit() { $this->mock_customer_service ); - $this->assertSame( $upe_checkout->get_payment_fields_js_config()['paymentMethodsConfig'][ Payment_Method::SEPA ]['showSaveOption'], true ); + $this->assertSame( $upe_checkout->get_payment_fields_js_config()['paymentMethodsConfig'][ Payment_Method::SEPA ]['showSaveOption'], false ); } public function test_remove_link_payment_method_if_card_disabled() {