diff --git a/modules/ppcp-compat/src/CompatModule.php b/modules/ppcp-compat/src/CompatModule.php index 3b155cff7..34429215c 100644 --- a/modules/ppcp-compat/src/CompatModule.php +++ b/modules/ppcp-compat/src/CompatModule.php @@ -13,7 +13,7 @@ use Dhii\Container\ServiceProvider; use Dhii\Modular\Module\ModuleInterface; use Interop\Container\ServiceProviderInterface; use Psr\Container\ContainerInterface; -use WooCommerce\PayPalCommerce\Compat\PPEC\PpecHelper; +use WooCommerce\PayPalCommerce\Compat\PPEC\PPECHelper; /** * Class CompatModule diff --git a/modules/ppcp-compat/src/PPEC/DeactivateNote.php b/modules/ppcp-compat/src/PPEC/DeactivateNote.php index e832c5dc8..07e0dbe1b 100644 --- a/modules/ppcp-compat/src/PPEC/DeactivateNote.php +++ b/modules/ppcp-compat/src/PPEC/DeactivateNote.php @@ -29,7 +29,7 @@ class DeactivateNote { * Note initialization. */ public static function init() { - if ( ! PpecHelper::is_plugin_active() ) { + if ( ! PPECHelper::is_plugin_active() ) { self::maybe_mark_note_as_actioned(); return; } @@ -47,7 +47,7 @@ class DeactivateNote { * @return Automatic\WooCommerce\Admin\Notes\Note */ public static function get_note() { - if ( PpecHelper::site_has_ppec_subscriptions() ) { + if ( PPECHelper::site_has_ppec_subscriptions() ) { $msg = __( 'As of 1 Sept 2021, PayPal Checkout will be officially retired from WooCommerce.com, and support for this product will end as of 1 March 2022. PayPal Payments can now handle all your subscription renewals even if they were first created using PayPal Checkout. To fully switch over, all you need to do is deactivate and/or remove the PayPal Checkout plugin from your store.', 'woocommerce-paypal-payments' @@ -70,7 +70,7 @@ class DeactivateNote { $note->add_action( 'deactivate-paypal-checkout-plugin', __( 'Deactivate PayPal Checkout', 'woocommerce-paypal-payments' ), - admin_url( 'plugins.php?action=deactivate&plugin=' . rawurlencode( PpecHelper::PPEC_PLUGIN_FILE ) . '&plugin_status=all&paged=1&_wpnonce=' . wp_create_nonce( 'deactivate-plugin_' . PpecHelper::PPEC_PLUGIN_FILE ) ), + admin_url( 'plugins.php?action=deactivate&plugin=' . rawurlencode( PPECHelper::PPEC_PLUGIN_FILE ) . '&plugin_status=all&paged=1&_wpnonce=' . wp_create_nonce( 'deactivate-plugin_' . PPECHelper::PPEC_PLUGIN_FILE ) ), Note::E_WC_ADMIN_NOTE_UNACTIONED, true ); diff --git a/modules/ppcp-compat/src/PPEC/MockGateway.php b/modules/ppcp-compat/src/PPEC/MockGateway.php index 43d2e65b2..cc070c048 100644 --- a/modules/ppcp-compat/src/PPEC/MockGateway.php +++ b/modules/ppcp-compat/src/PPEC/MockGateway.php @@ -18,7 +18,7 @@ class MockGateway extends \WC_Payment_Gateway { * @param string $title Gateway title. */ public function __construct( $title ) { - $this->id = PpecHelper::PPEC_GATEWAY_ID; + $this->id = PPECHelper::PPEC_GATEWAY_ID; $this->title = $title; $this->method_title = $this->title; $this->description = ''; diff --git a/modules/ppcp-compat/src/PPEC/PpecHelper.php b/modules/ppcp-compat/src/PPEC/PPECHelper.php similarity index 99% rename from modules/ppcp-compat/src/PPEC/PpecHelper.php rename to modules/ppcp-compat/src/PPEC/PPECHelper.php index 2adc9f118..0f13aafe5 100644 --- a/modules/ppcp-compat/src/PPEC/PpecHelper.php +++ b/modules/ppcp-compat/src/PPEC/PPECHelper.php @@ -11,7 +11,7 @@ namespace WooCommerce\PayPalCommerce\Compat\PPEC; * Helper class with various constants associated to the PayPal Express Checkout plugin, as well as methods for figuring * out the status of the gateway. */ -class PpecHelper { +class PPECHelper { /** * The PayPal Express Checkout gateway ID. diff --git a/modules/ppcp-compat/src/PPEC/SettingsImporter.php b/modules/ppcp-compat/src/PPEC/SettingsImporter.php index 25f1721a9..f2c539a28 100644 --- a/modules/ppcp-compat/src/PPEC/SettingsImporter.php +++ b/modules/ppcp-compat/src/PPEC/SettingsImporter.php @@ -38,7 +38,7 @@ class SettingsImporter { */ public function __construct( Settings $settings ) { $this->ppcp_settings = $settings; - $this->ppec_settings = (array) get_option( PpecHelper::PPEC_SETTINGS_OPTION_NAME, array() ); + $this->ppec_settings = (array) get_option( PPECHelper::PPEC_SETTINGS_OPTION_NAME, array() ); } /** @@ -48,7 +48,7 @@ class SettingsImporter { */ public function maybe_hook() { // Import settings the first time the PPCP option is created. - if ( PpecHelper::is_gateway_available() && false === get_option( $this->ppcp_settings::KEY ) ) { + if ( PPECHelper::is_gateway_available() && false === get_option( $this->ppcp_settings::KEY ) ) { add_action( 'add_option_' . $this->ppcp_settings::KEY, array( $this, 'import_settings' ), 10, 2 ); } } diff --git a/modules/ppcp-compat/src/PPEC/SubscriptionsHandler.php b/modules/ppcp-compat/src/PPEC/SubscriptionsHandler.php index 43889c2bc..0881c40a5 100644 --- a/modules/ppcp-compat/src/PPEC/SubscriptionsHandler.php +++ b/modules/ppcp-compat/src/PPEC/SubscriptionsHandler.php @@ -51,7 +51,7 @@ class SubscriptionsHandler { * @return void */ public function maybe_hook() { - if ( ! PpecHelper::use_ppec_compat_layer_for_subscriptions() ) { + if ( ! PPECHelper::use_ppec_compat_layer_for_subscriptions() ) { return; } @@ -62,7 +62,7 @@ class SubscriptionsHandler { add_filter( 'woocommerce_paypal_payments_valid_payment_token_types', array( $this, 'add_billing_agreement_as_token_type' ) ); // Process PPEC renewals through PayPal Payments. - add_action( 'woocommerce_scheduled_subscription_payment_' . PpecHelper::PPEC_GATEWAY_ID, array( $this, 'process_renewal' ), 10, 2 ); + add_action( 'woocommerce_scheduled_subscription_payment_' . PPECHelper::PPEC_GATEWAY_ID, array( $this, 'process_renewal' ), 10, 2 ); } /** @@ -74,8 +74,8 @@ class SubscriptionsHandler { * @return array */ public function add_mock_ppec_gateway( $gateways ) { - if ( ! isset( $gateways[ PpecHelper::PPEC_GATEWAY_ID ] ) && $this->should_mock_ppec_gateway() ) { - $gateways[ PpecHelper::PPEC_GATEWAY_ID ] = $this->mock_gateway; + if ( ! isset( $gateways[ PPECHelper::PPEC_GATEWAY_ID ] ) && $this->should_mock_ppec_gateway() ) { + $gateways[ PPECHelper::PPEC_GATEWAY_ID ] = $this->mock_gateway; } return $gateways; @@ -121,7 +121,7 @@ class SubscriptionsHandler { * @return null|PaymentToken */ public function use_billing_agreement_as_token( $token, $customer, $order ) { - if ( PpecHelper::PPEC_GATEWAY_ID === $order->get_payment_method() && wcs_order_contains_renewal( $order ) ) { + if ( PPECHelper::PPEC_GATEWAY_ID === $order->get_payment_method() && wcs_order_contains_renewal( $order ) ) { $billing_agreement_id = $order->get_meta( '_ppec_billing_agreement_id', true ); if ( $billing_agreement_id ) { @@ -154,21 +154,21 @@ class SubscriptionsHandler { if ( wcs_is_view_subscription_page() ) { $subscription = wcs_get_subscription( absint( get_query_var( 'view-subscription' ) ) ); - return ( $subscription && PpecHelper::PPEC_GATEWAY_ID === $subscription->get_payment_method() ); + return ( $subscription && PPECHelper::PPEC_GATEWAY_ID === $subscription->get_payment_method() ); } // Changing payment method? if ( is_wc_endpoint_url( 'order-pay' ) && isset( $_GET['change_payment_method'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $subscription = wcs_get_subscription( absint( get_query_var( 'order-pay' ) ) ); - return ( $subscription && PpecHelper::PPEC_GATEWAY_ID === $subscription->get_payment_method() ); + return ( $subscription && PPECHelper::PPEC_GATEWAY_ID === $subscription->get_payment_method() ); } // Early renew (via modal). if ( isset( $_GET['process_early_renewal'], $_GET['subscription_id'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended $subscription = wcs_get_subscription( absint( $_GET['subscription_id'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended - return ( $subscription && PpecHelper::PPEC_GATEWAY_ID === $subscription->get_payment_method() ); + return ( $subscription && PPECHelper::PPEC_GATEWAY_ID === $subscription->get_payment_method() ); } } @@ -192,7 +192,7 @@ class SubscriptionsHandler { if ( in_array( get_current_screen()->id, array( 'shop_subscription', 'shop_order' ), true ) ) { $order = wc_get_order( $GLOBALS['post']->ID ); - return ( $order && PpecHelper::PPEC_GATEWAY_ID === $order->get_payment_method() ); + return ( $order && PPECHelper::PPEC_GATEWAY_ID === $order->get_payment_method() ); } }