diff --git a/includes/class-wc-payment-gateway-wcpay.php b/includes/class-wc-payment-gateway-wcpay.php index d7a3a433e42..f3f81601e90 100644 --- a/includes/class-wc-payment-gateway-wcpay.php +++ b/includes/class-wc-payment-gateway-wcpay.php @@ -3614,12 +3614,12 @@ public static function is_current_page_settings() { * Isolated as a separate method in order to be available both * during the classic checkout, as well as the checkout block. * - * @deprecated use WC_Payments_UPE_Checkout::get_payment_fields_js_config instead. + * @deprecated use WC_Payments_Checkout::get_payment_fields_js_config instead. * * @return array */ public function get_payment_fields_js_config() { - wc_deprecated_function( __FUNCTION__, '5.0.0', 'WC_Payments_UPE_Checkout::get_payment_fields_js_config' ); + wc_deprecated_function( __FUNCTION__, '5.0.0', 'WC_Payments_Checkout::get_payment_fields_js_config' ); return WC_Payments::get_wc_payments_checkout()->get_payment_fields_js_config(); } diff --git a/includes/class-wc-payments-blocks-payment-method.php b/includes/class-wc-payments-blocks-payment-method.php index b9908dad952..8172cab1438 100644 --- a/includes/class-wc-payments-blocks-payment-method.php +++ b/includes/class-wc-payments-blocks-payment-method.php @@ -7,7 +7,7 @@ use Automattic\WooCommerce\Blocks\Payments\Integrations\AbstractPaymentMethodType; use WCPay\Fraud_Prevention\Fraud_Prevention_Service; -use WCPay\WC_Payments_UPE_Checkout; +use WCPay\WC_Payments_Checkout; use WCPay\WooPay\WooPay_Utilities; /** @@ -24,7 +24,7 @@ class WC_Payments_Blocks_Payment_Method extends AbstractPaymentMethodType { /** * WC Payments Checkout * - * @var WC_Payments_UPE_Checkout + * @var WC_Payments_Checkout */ private $wc_payments_checkout; diff --git a/includes/class-wc-payments-upe-checkout.php b/includes/class-wc-payments-checkout.php similarity index 99% rename from includes/class-wc-payments-upe-checkout.php rename to includes/class-wc-payments-checkout.php index 94cf5d8f2f0..9851a2ea0c2 100644 --- a/includes/class-wc-payments-upe-checkout.php +++ b/includes/class-wc-payments-checkout.php @@ -1,6 +1,6 @@ init_hooks(); self::$wc_payments_checkout->init_hooks(); @@ -1182,9 +1182,9 @@ public static function get_gateway() { } /** - * Returns the WC_Payments_UPE_Checkout instance + * Returns the WC_Payments_Checkout instance * - * @return WC_Payments_UPE_Checkout gateway instance + * @return WC_Payments_Checkout gateway instance */ public static function get_wc_payments_checkout() { return self::$wc_payments_checkout; diff --git a/includes/payment-methods/class-upe-payment-gateway.php b/includes/payment-methods/class-upe-payment-gateway.php index a8cfbbfced1..b1ba28589b6 100644 --- a/includes/payment-methods/class-upe-payment-gateway.php +++ b/includes/payment-methods/class-upe-payment-gateway.php @@ -854,7 +854,7 @@ public function is_proper_intent_used_with_order( $order, $intent_id_from_reques * @return array */ public function get_payment_fields_js_config() { - wc_deprecated_function( __FUNCTION__, '5.0.0', 'WC_Payments_UPE_Checkout::get_payment_fields_js_config' ); + wc_deprecated_function( __FUNCTION__, '5.0.0', 'WC_Payments_Checkout::get_payment_fields_js_config' ); return WC_Payments::get_wc_payments_checkout()->get_payment_fields_js_config(); } @@ -1111,7 +1111,7 @@ private function validate_order_id_received_vs_intent_meta_order_id( WC_Order $o * @return array */ private function get_enabled_payment_method_config() { - wc_deprecated_function( __FUNCTION__, '5.0.0', 'WC_Payments_UPE_Checkout::get_enabled_payment_method_config' ); + wc_deprecated_function( __FUNCTION__, '5.0.0', 'WC_Payments_Checkout::get_enabled_payment_method_config' ); return WC_Payments::get_wc_payments_checkout()->get_enabled_payment_method_config(); } diff --git a/src/Internal/DependencyManagement/DelegateContainer/LegacyContainer.php b/src/Internal/DependencyManagement/DelegateContainer/LegacyContainer.php index 5a1c09ca36c..bf4854a70ba 100644 --- a/src/Internal/DependencyManagement/DelegateContainer/LegacyContainer.php +++ b/src/Internal/DependencyManagement/DelegateContainer/LegacyContainer.php @@ -89,11 +89,11 @@ private function get_wcpay_woopay_tracker_instance() { } /** - * Returns the WC_Payments_UPE_Checkout instance. + * Returns the WC_Payments_Checkout instance. * - * @return \WCPay\WC_Payments_UPE_Checkout + * @return \WCPay\WC_Payments_Checkout */ - private function get_wcpay_wc_payments_upe_checkout_instance() { + private function get_wcpay_wc_payments_checkout_instance() { return WC_Payments::get_wc_payments_checkout(); } diff --git a/src/Internal/DependencyManagement/DelegateContainer/REAMDE.md b/src/Internal/DependencyManagement/DelegateContainer/REAMDE.md index f998ffcd18e..f1819e4913b 100644 --- a/src/Internal/DependencyManagement/DelegateContainer/REAMDE.md +++ b/src/Internal/DependencyManagement/DelegateContainer/REAMDE.md @@ -41,7 +41,7 @@ This is a list of the currently supported legacy classes by the container. - `WCPay\Core\Mode` - `WC_Payment_Gateway_WCPay` - `WCPay\WooPay_Tracker` -- `WCPay\WC_Payments_UPE_Checkout` +- `WCPay\WC_Payments_Checkout` - `WCPay\Database_Cache` - `WC_Payments_Account` - `WC_Payments_API_Client` 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 7ca31052a47..647d7633eea 100644 --- a/tests/unit/payment-methods/test-class-upe-payment-gateway.php +++ b/tests/unit/payment-methods/test-class-upe-payment-gateway.php @@ -21,7 +21,7 @@ use WCPay\Exceptions\Process_Payment_Exception; use WCPay\WooPay\WooPay_Utilities; use WCPay\Session_Rate_Limiter; -use WCPay\WC_Payments_UPE_Checkout; +use WCPay\WC_Payments_Checkout; use WCPAY_UnitTestCase; use WC_Helper_Order; use WC_Helper_Intention; @@ -349,8 +349,8 @@ public function test_payment_fields_outputs_fields() { $this->set_cart_contains_subscription_items( false ); $this->set_get_upe_enabled_payment_method_statuses_return_value(); - // Add the UPE Checkout action. - $checkout = new WC_Payments_UPE_Checkout( + // Add the checkout action. + $checkout = new WC_Payments_Checkout( $this->mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -1837,7 +1837,7 @@ public function test_remove_link_payment_method_if_card_disabled() { $this->returnValue( [ 'link_payments' => [ 'status' => 'active' ] ] ) ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -1903,7 +1903,7 @@ public function test_link_payment_method_if_card_enabled() { $this->returnValue( $this->icon_url ) ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, 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 0b7e1b2593d..b602010f435 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 @@ -16,7 +16,7 @@ use WCPay\Exceptions\Amount_Too_Small_Exception; use WCPay\WooPay\WooPay_Utilities; use WCPay\Session_Rate_Limiter; -use WCPay\WC_Payments_UPE_Checkout; +use WCPay\WC_Payments_Checkout; use WCPAY_UnitTestCase; use WC_Helper_Order; use WC_Helper_Intention; @@ -362,7 +362,7 @@ public function tear_down() { * @return void */ public function test_payment_fields_outputs_fields() { - $checkout = new WC_Payments_UPE_Checkout( + $checkout = new WC_Payments_Checkout( $this->mock_payment_gateways[ Payment_Method::CARD ], $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -1767,7 +1767,7 @@ public function test_no_save_option_for_non_sepa_upe() { ->with( $payment_method ) ->willReturn( $this->mock_payment_gateways[ $payment_method ] ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -1835,7 +1835,7 @@ public function test_no_save_option_for_sepa_due_to_subscription_cart() { ->with( Payment_Method::SEPA ) ->willReturn( $this->mock_payment_gateways[ Payment_Method::SEPA ] ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -1902,7 +1902,7 @@ public function test_no_save_option_for_sepa_due_to_saved_cards_disabled() { ->with( Payment_Method::SEPA ) ->willReturn( $this->mock_payment_gateways[ Payment_Method::SEPA ] ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -1969,7 +1969,7 @@ public function test_save_option_for_sepa_debit() { $this->returnValue( false ) ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -2024,7 +2024,7 @@ public function test_remove_link_payment_method_if_card_disabled() { ->with( Payment_Method::LINK ) ->willReturn( $this->mock_payment_methods[ Payment_Method::LINK ] ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, @@ -2110,7 +2110,7 @@ function ( $payment_method ) { } ); - $upe_checkout = new WC_Payments_UPE_Checkout( + $upe_checkout = new WC_Payments_Checkout( $mock_upe_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, diff --git a/tests/unit/src/Internal/DependencyManagement/DelegateContainer/LegacyContainerTest.php b/tests/unit/src/Internal/DependencyManagement/DelegateContainer/LegacyContainerTest.php index e690599d0c5..584785b4621 100644 --- a/tests/unit/src/Internal/DependencyManagement/DelegateContainer/LegacyContainerTest.php +++ b/tests/unit/src/Internal/DependencyManagement/DelegateContainer/LegacyContainerTest.php @@ -40,7 +40,7 @@ public function available_classes_provider() { [ \WCPay\Core\Mode::class ], [ \WC_Payment_Gateway_WCPay::class ], [ \WCPay\WooPay_Tracker::class ], - [ \WCPay\WC_Payments_UPE_Checkout::class ], + [ \WCPay\WC_Payments_Checkout::class ], [ \WCPay\Database_Cache::class ], [ \WC_Payments_Account::class ], [ \WC_Payments_API_Client::class ], diff --git a/tests/unit/test-class-wc-payments-upe-checkout.php b/tests/unit/test-class-wc-payments-checkout.php similarity index 96% rename from tests/unit/test-class-wc-payments-upe-checkout.php rename to tests/unit/test-class-wc-payments-checkout.php index 5dc569fee66..926b966fcd9 100644 --- a/tests/unit/test-class-wc-payments-upe-checkout.php +++ b/tests/unit/test-class-wc-payments-checkout.php @@ -5,23 +5,23 @@ * @package WooCommerce\Payments\Tests */ -use WCPay\WC_Payments_UPE_Checkout; +use WCPay\WC_Payments_Checkout; use PHPUnit\Framework\MockObject\MockObject; use WCPay\Payment_Methods\UPE_Split_Payment_Gateway; use WCPay\WooPay\WooPay_Utilities; use WCPay\Fraud_Prevention\Fraud_Prevention_Service; /** - * Class WC_Payments_UPE_Checkout_Test + * Class WC_Payments_Checkout_Test * * @package WooCommerce\Payments\Tests */ -class WC_Payments_UPE_Checkout_Test extends WP_UnitTestCase { +class WC_Payments_Checkout_Test extends WP_UnitTestCase { /** * Holds the object, which will be tested. * - * @var WC_Payments_UPE_Checkout + * @var WC_Payments_Checkout */ private $system_under_test; @@ -112,7 +112,7 @@ function ( $output ) { } ); - $this->system_under_test = new WC_Payments_UPE_Checkout( $this->mock_wcpay_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, $this->mock_customer_service, $this->mock_fraud_service ); + $this->system_under_test = new WC_Payments_Checkout( $this->mock_wcpay_gateway, $this->mock_woopay_utilities, $this->mock_wcpay_account, $this->mock_customer_service, $this->mock_fraud_service ); } public function tear_down() {