Skip to content

Commit

Permalink
rename WC_Payments_UPE_Checkout to WC_Payments_Checkout for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Karimov committed Dec 18, 2023
1 parent a9eb6b2 commit 21d1935
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions includes/class-wc-payment-gateway-wcpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions includes/class-wc-payments-blocks-payment-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Class WC_Payments_UPE_Checkout
* Class WC_Payments_Checkout
*
* @package WooCommerce\Payments
*/
Expand All @@ -25,9 +25,9 @@


/**
* WC_Payments_UPE_Checkout
* WC_Payments_Checkout
*/
class WC_Payments_UPE_Checkout {
class WC_Payments_Checkout {

/**
* WC Payments Gateway.
Expand Down
12 changes: 6 additions & 6 deletions includes/class-wc-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
use WCPay\Payment_Methods\Afterpay_Payment_Method;
use WCPay\Session_Rate_Limiter;
use WCPay\Database_Cache;
use WCPay\WC_Payments_UPE_Checkout;
use WCPay\WC_Payments_Checkout;
use WCPay\WooPay\Service\Checkout_Service;
use WCPay\Core\WC_Payments_Customer_Service_API;
use WCPay\Constants\Payment_Method;
Expand Down Expand Up @@ -263,7 +263,7 @@ class WC_Payments {
/**
* WC Payments Checkout
*
* @var WC_Payments_UPE_Checkout
* @var WC_Payments_Checkout
*/
private static $wc_payments_checkout;

Expand Down Expand Up @@ -397,7 +397,7 @@ public static function init() {
include_once __DIR__ . '/class-logger.php';
include_once __DIR__ . '/class-session-rate-limiter.php';
include_once __DIR__ . '/class-wc-payment-gateway-wcpay.php';
include_once __DIR__ . '/class-wc-payments-upe-checkout.php';
include_once __DIR__ . '/class-wc-payments-checkout.php';
include_once __DIR__ . '/payment-methods/class-cc-payment-gateway.php';
include_once __DIR__ . '/payment-methods/class-upe-payment-gateway.php';
include_once __DIR__ . '/payment-methods/class-upe-split-payment-gateway.php';
Expand Down Expand Up @@ -552,7 +552,7 @@ public static function init() {
}

self::$card_gateway = self::get_payment_gateway_by_id( 'card' );
self::$wc_payments_checkout = new WC_Payments_UPE_Checkout( self::get_gateway(), self::$woopay_util, self::$account, self::$customer_service, self::$fraud_service );
self::$wc_payments_checkout = new WC_Payments_Checkout( self::get_gateway(), self::$woopay_util, self::$account, self::$customer_service, self::$fraud_service );

self::$card_gateway->init_hooks();
self::$wc_payments_checkout->init_hooks();
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions includes/payment-methods/class-upe-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/payment-methods/test-class-upe-payment-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 21d1935

Please sign in to comment.