mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
🚚 Rename CommonSettings to GeneralSettings
This commit is contained in:
parent
50cceadd25
commit
4a7c7517a7
5 changed files with 21 additions and 21 deletions
|
@ -129,16 +129,16 @@ return array(
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
new SettingsMap(
|
new SettingsMap(
|
||||||
$container->get( 'settings.data.common' ),
|
$container->get( 'settings.data.general' ),
|
||||||
array(
|
array(
|
||||||
'client_id' => 'client_id',
|
'client_id' => 'client_id',
|
||||||
'client_secret' => 'client_secret',
|
'client_secret' => 'client_secret',
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
new SettingsMap(
|
new SettingsMap(
|
||||||
$container->get( 'settings.data.common' ),
|
$container->get( 'settings.data.general' ),
|
||||||
/**
|
/**
|
||||||
* The new CommonSettings class stores the current connection
|
* The new GeneralSettings class stores the current connection
|
||||||
* details, without adding an environment-suffix (no `_sandbox`
|
* details, without adding an environment-suffix (no `_sandbox`
|
||||||
* or `_production` in the field name)
|
* or `_production` in the field name)
|
||||||
* Only the `sandbox_merchant` flag indicates, which environment
|
* Only the `sandbox_merchant` flag indicates, which environment
|
||||||
|
|
|
@ -11,7 +11,7 @@ namespace WooCommerce\PayPalCommerce\Settings;
|
||||||
|
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
use WooCommerce\PayPalCommerce\ApiClient\Helper\Cache;
|
||||||
use WooCommerce\PayPalCommerce\Settings\Ajax\SwitchSettingsUiEndpoint;
|
use WooCommerce\PayPalCommerce\Settings\Ajax\SwitchSettingsUiEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Settings\Data\CommonSettings;
|
use WooCommerce\PayPalCommerce\Settings\Data\GeneralSettings;
|
||||||
use WooCommerce\PayPalCommerce\Settings\Data\OnboardingProfile;
|
use WooCommerce\PayPalCommerce\Settings\Data\OnboardingProfile;
|
||||||
use WooCommerce\PayPalCommerce\Settings\Endpoint\AuthenticationRestEndpoint;
|
use WooCommerce\PayPalCommerce\Settings\Endpoint\AuthenticationRestEndpoint;
|
||||||
use WooCommerce\PayPalCommerce\Settings\Endpoint\CommonRestEndpoint;
|
use WooCommerce\PayPalCommerce\Settings\Endpoint\CommonRestEndpoint;
|
||||||
|
@ -57,8 +57,8 @@ return array(
|
||||||
$can_use_subscriptions
|
$can_use_subscriptions
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
'settings.data.common' => static function ( ContainerInterface $container ) : CommonSettings {
|
'settings.data.general' => static function ( ContainerInterface $container ) : GeneralSettings {
|
||||||
return new CommonSettings(
|
return new GeneralSettings(
|
||||||
$container->get( 'api.shop.country' ),
|
$container->get( 'api.shop.country' ),
|
||||||
$container->get( 'api.shop.currency.getter' )->get(),
|
$container->get( 'api.shop.currency.getter' )->get(),
|
||||||
);
|
);
|
||||||
|
@ -67,7 +67,7 @@ return array(
|
||||||
return new OnboardingRestEndpoint( $container->get( 'settings.data.onboarding' ) );
|
return new OnboardingRestEndpoint( $container->get( 'settings.data.onboarding' ) );
|
||||||
},
|
},
|
||||||
'settings.rest.common' => static function ( ContainerInterface $container ) : CommonRestEndpoint {
|
'settings.rest.common' => static function ( ContainerInterface $container ) : CommonRestEndpoint {
|
||||||
return new CommonRestEndpoint( $container->get( 'settings.data.common' ) );
|
return new CommonRestEndpoint( $container->get( 'settings.data.general' ) );
|
||||||
},
|
},
|
||||||
'settings.rest.refresh_feature_status' => static function ( ContainerInterface $container ) : RefreshFeatureStatusEndpoint {
|
'settings.rest.refresh_feature_status' => static function ( ContainerInterface $container ) : RefreshFeatureStatusEndpoint {
|
||||||
return new RefreshFeatureStatusEndpoint(
|
return new RefreshFeatureStatusEndpoint(
|
||||||
|
@ -178,7 +178,7 @@ return array(
|
||||||
},
|
},
|
||||||
'settings.service.authentication_manager' => static function ( ContainerInterface $container ) : AuthenticationManager {
|
'settings.service.authentication_manager' => static function ( ContainerInterface $container ) : AuthenticationManager {
|
||||||
return new AuthenticationManager(
|
return new AuthenticationManager(
|
||||||
$container->get( 'settings.data.common' ),
|
$container->get( 'settings.data.general' ),
|
||||||
$container->get( 'api.env.paypal-host' ),
|
$container->get( 'api.env.paypal-host' ),
|
||||||
$container->get( 'api.env.endpoint.login-seller' ),
|
$container->get( 'api.env.endpoint.login-seller' ),
|
||||||
$container->get( 'api.repository.partner-referrals-data' ),
|
$container->get( 'api.repository.partner-referrals-data' ),
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
/**
|
/**
|
||||||
* Common settings class
|
* General plugin settings class
|
||||||
*
|
*
|
||||||
* @package WooCommerce\PayPalCommerce\Settings\Data
|
* @package WooCommerce\PayPalCommerce\Settings\Data
|
||||||
*/
|
*/
|
||||||
|
@ -13,7 +13,7 @@ use RuntimeException;
|
||||||
use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO;
|
use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CommonSettings
|
* Class GeneralSettings
|
||||||
*
|
*
|
||||||
* This class serves as a container for managing the common settings that
|
* This class serves as a container for managing the common settings that
|
||||||
* are used and managed in various areas of the settings UI
|
* are used and managed in various areas of the settings UI
|
||||||
|
@ -21,7 +21,7 @@ use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO;
|
||||||
* Those settings mainly describe connection details and are initially collected
|
* Those settings mainly describe connection details and are initially collected
|
||||||
* in the onboarding wizard, and also appear in the settings screen.
|
* in the onboarding wizard, and also appear in the settings screen.
|
||||||
*/
|
*/
|
||||||
class CommonSettings extends AbstractDataModel {
|
class GeneralSettings extends AbstractDataModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Option key where profile details are stored.
|
* Option key where profile details are stored.
|
|
@ -12,7 +12,7 @@ namespace WooCommerce\PayPalCommerce\Settings\Endpoint;
|
||||||
use WP_REST_Server;
|
use WP_REST_Server;
|
||||||
use WP_REST_Response;
|
use WP_REST_Response;
|
||||||
use WP_REST_Request;
|
use WP_REST_Request;
|
||||||
use WooCommerce\PayPalCommerce\Settings\Data\CommonSettings;
|
use WooCommerce\PayPalCommerce\Settings\Data\GeneralSettings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* REST controller for "common" settings, which are used and modified by
|
* REST controller for "common" settings, which are used and modified by
|
||||||
|
@ -32,9 +32,9 @@ class CommonRestEndpoint extends RestEndpoint {
|
||||||
/**
|
/**
|
||||||
* The settings instance.
|
* The settings instance.
|
||||||
*
|
*
|
||||||
* @var CommonSettings
|
* @var GeneralSettings
|
||||||
*/
|
*/
|
||||||
protected CommonSettings $settings;
|
protected GeneralSettings $settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Field mapping for request to profile transformation.
|
* Field mapping for request to profile transformation.
|
||||||
|
@ -98,9 +98,9 @@ class CommonRestEndpoint extends RestEndpoint {
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param CommonSettings $settings The settings instance.
|
* @param GeneralSettings $settings The settings instance.
|
||||||
*/
|
*/
|
||||||
public function __construct( CommonSettings $settings ) {
|
public function __construct( GeneralSettings $settings ) {
|
||||||
$this->settings = $settings;
|
$this->settings = $settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ use WooCommerce\PayPalCommerce\ApiClient\Endpoint\LoginSeller;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\Orders;
|
use WooCommerce\PayPalCommerce\ApiClient\Endpoint\Orders;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Helper\InMemoryCache;
|
use WooCommerce\PayPalCommerce\ApiClient\Helper\InMemoryCache;
|
||||||
use WooCommerce\PayPalCommerce\ApiClient\Repository\PartnerReferralsData;
|
use WooCommerce\PayPalCommerce\ApiClient\Repository\PartnerReferralsData;
|
||||||
use WooCommerce\PayPalCommerce\Settings\Data\CommonSettings;
|
use WooCommerce\PayPalCommerce\Settings\Data\GeneralSettings;
|
||||||
use WooCommerce\PayPalCommerce\WcGateway\Helper\EnvironmentConfig;
|
use WooCommerce\PayPalCommerce\WcGateway\Helper\EnvironmentConfig;
|
||||||
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
||||||
use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO;
|
use WooCommerce\PayPalCommerce\Settings\DTO\MerchantConnectionDTO;
|
||||||
|
@ -30,9 +30,9 @@ class AuthenticationManager {
|
||||||
/**
|
/**
|
||||||
* Data model that stores the connection details.
|
* Data model that stores the connection details.
|
||||||
*
|
*
|
||||||
* @var CommonSettings
|
* @var GeneralSettings
|
||||||
*/
|
*/
|
||||||
private CommonSettings $common_settings;
|
private GeneralSettings $common_settings;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logging instance.
|
* Logging instance.
|
||||||
|
@ -65,14 +65,14 @@ class AuthenticationManager {
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param CommonSettings $common_settings Data model that stores the connection details.
|
* @param GeneralSettings $common_settings Data model that stores the connection details.
|
||||||
* @param EnvironmentConfig $connection_host API host for direct authentication.
|
* @param EnvironmentConfig $connection_host API host for direct authentication.
|
||||||
* @param EnvironmentConfig $login_endpoint API handler to fetch merchant credentials.
|
* @param EnvironmentConfig $login_endpoint API handler to fetch merchant credentials.
|
||||||
* @param PartnerReferralsData $referrals_data Partner referrals data.
|
* @param PartnerReferralsData $referrals_data Partner referrals data.
|
||||||
* @param ?LoggerInterface $logger Logging instance.
|
* @param ?LoggerInterface $logger Logging instance.
|
||||||
*/
|
*/
|
||||||
public function __construct(
|
public function __construct(
|
||||||
CommonSettings $common_settings,
|
GeneralSettings $common_settings,
|
||||||
EnvironmentConfig $connection_host,
|
EnvironmentConfig $connection_host,
|
||||||
EnvironmentConfig $login_endpoint,
|
EnvironmentConfig $login_endpoint,
|
||||||
PartnerReferralsData $referrals_data,
|
PartnerReferralsData $referrals_data,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue