🚚 Rename configuration class

The class name does not reflect the purpose of the class
This commit is contained in:
Philipp Stracker 2025-03-14 16:15:23 +01:00
parent 29f56a7db8
commit afb7044b03
No known key found for this signature in database
17 changed files with 123 additions and 129 deletions

View file

@ -17,7 +17,7 @@ use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\CreditCardGateway;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCGatewayConfiguration;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CardPaymentsConfiguration;
use WooCommerce\PayPalCommerce\ApiClient\Helper\CurrencyGetter;
return array(
@ -229,7 +229,7 @@ return array(
'axo.smart-button-location-notice' => static function ( ContainerInterface $container ) : string {
$dcc_configuration = $container->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
assert( $dcc_configuration instanceof CardPaymentsConfiguration );
if ( $dcc_configuration->use_fastlane() ) {
$fastlane_settings_url = admin_url(

View file

@ -30,7 +30,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Helper\CartCheckoutDetector;
use WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsListener;
use WooCommerce\PayPalCommerce\WcSubscriptions\Helper\SubscriptionHelper;
use WC_Payment_Gateways;
use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCGatewayConfiguration;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CardPaymentsConfiguration;
/**
* Class AxoModule
@ -99,7 +99,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
}
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
assert( $dcc_configuration instanceof CardPaymentsConfiguration );
if ( ! $dcc_configuration->is_enabled() ) {
return $methods;
@ -165,7 +165,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
assert( $listener instanceof SettingsListener );
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
assert( $dcc_configuration instanceof CardPaymentsConfiguration );
$listener->filter_settings(
$dcc_configuration->use_fastlane(),
@ -248,7 +248,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
'woocommerce_paypal_payments_sdk_components_hook',
function( $components ) use ( $c ) {
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
assert( $dcc_configuration instanceof CardPaymentsConfiguration );
if ( ! $dcc_configuration->use_fastlane() ) {
return $components;
@ -263,7 +263,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
function () use ( $c ) {
// Add meta tag to allow feature-detection of the site's AXO payment state.
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
assert( $dcc_configuration instanceof CardPaymentsConfiguration );
if ( $dcc_configuration->use_fastlane() ) {
// phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
@ -404,7 +404,7 @@ class AxoModule implements ServiceModule, ExtendingModule, ExecutableModule {
*/
private function should_render_fastlane( ContainerInterface $c ): bool {
$dcc_configuration = $c->get( 'wcgateway.configuration.card-configuration' );
assert( $dcc_configuration instanceof DCCGatewayConfiguration );
assert( $dcc_configuration instanceof CardPaymentsConfiguration );
$subscription_helper = $c->get( 'wc-subscriptions.helper' );
assert( $subscription_helper instanceof SubscriptionHelper );

View file

@ -29,7 +29,7 @@ use WooCommerce\PayPalCommerce\WcGateway\Settings\SettingsRenderer;
use WooCommerce\PayPalCommerce\WcGateway\Gateway\ProcessPaymentTrait;
use WooCommerce\PayPalCommerce\WcGateway\Exception\GatewayGenericException;
use WooCommerce\PayPalCommerce\Session\SessionHandler;
use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCGatewayConfiguration;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CardPaymentsConfiguration;
/**
* Class AXOGateway.
@ -56,9 +56,9 @@ class AxoGateway extends WC_Payment_Gateway {
/**
* Gateway configuration object, providing relevant settings.
*
* @var DCCGatewayConfiguration
* @var CardPaymentsConfiguration
*/
protected DCCGatewayConfiguration $dcc_configuration;
protected CardPaymentsConfiguration $dcc_configuration;
/**
* The WcGateway module URL.
@ -133,24 +133,24 @@ class AxoGateway extends WC_Payment_Gateway {
/**
* AXOGateway constructor.
*
* @param SettingsRenderer $settings_renderer The settings renderer.
* @param ContainerInterface $ppcp_settings The settings.
* @param DCCGatewayConfiguration $dcc_configuration The DCC Gateway configuration.
* @param string $wcgateway_module_url The WcGateway module URL.
* @param SessionHandler $session_handler The Session Handler.
* @param OrderProcessor $order_processor The Order processor.
* @param array $card_icons The card icons.
* @param OrderEndpoint $order_endpoint The order endpoint.
* @param PurchaseUnitFactory $purchase_unit_factory The purchase unit factory.
* @param SettingsRenderer $settings_renderer The settings renderer.
* @param ContainerInterface $ppcp_settings The settings.
* @param CardPaymentsConfiguration $dcc_configuration The DCC Gateway configuration.
* @param string $wcgateway_module_url The WcGateway module URL.
* @param SessionHandler $session_handler The Session Handler.
* @param OrderProcessor $order_processor The Order processor.
* @param array $card_icons The card icons.
* @param OrderEndpoint $order_endpoint The order endpoint.
* @param PurchaseUnitFactory $purchase_unit_factory The purchase unit factory.
* @param ShippingPreferenceFactory $shipping_preference_factory The shipping preference factory.
* @param TransactionUrlProvider $transaction_url_provider The transaction url provider.
* @param Environment $environment The environment.
* @param LoggerInterface $logger The logger.
* @param TransactionUrlProvider $transaction_url_provider The transaction url provider.
* @param Environment $environment The environment.
* @param LoggerInterface $logger The logger.
*/
public function __construct(
SettingsRenderer $settings_renderer,
ContainerInterface $ppcp_settings,
DCCGatewayConfiguration $dcc_configuration,
CardPaymentsConfiguration $dcc_configuration,
string $wcgateway_module_url,
SessionHandler $session_handler,
OrderProcessor $order_processor,

View file

@ -13,7 +13,7 @@ namespace WooCommerce\PayPalCommerce\Axo\Helper;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CartCheckoutDetector;
use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings;
use WooCommerce\PayPalCommerce\WcGateway\Exception\NotFoundException;
use WooCommerce\PayPalCommerce\WcGateway\Helper\DCCGatewayConfiguration;
use WooCommerce\PayPalCommerce\WcGateway\Helper\CardPaymentsConfiguration;
/**
* Class CompatibilityChecker
@ -38,18 +38,18 @@ class CompatibilityChecker {
/**
* Provides details about the DCC configuration.
*
* @var DCCGatewayConfiguration
* @var CardPaymentsConfiguration
*/
private DCCGatewayConfiguration $dcc_configuration;
private CardPaymentsConfiguration $dcc_configuration;
/**
* CompatibilityChecker constructor.
*
* @param string[] $incompatible_plugin_names The list of Fastlane incompatible
* plugin names.
* @param DCCGatewayConfiguration $dcc_configuration DCC gateway configuration.
* @param string[] $incompatible_plugin_names The list of Fastlane incompatible
* plugin names.
* @param CardPaymentsConfiguration $dcc_configuration DCC gateway configuration.
*/
public function __construct( array $incompatible_plugin_names, DCCGatewayConfiguration $dcc_configuration ) {
public function __construct( array $incompatible_plugin_names, CardPaymentsConfiguration $dcc_configuration ) {
$this->incompatible_plugin_names = $incompatible_plugin_names;
$this->dcc_configuration = $dcc_configuration;