| @@ -6,10 +6,8 @@ | ||
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | namespace SeQura\WC; |
| 9 | 9 | |
| 10 | -use SeQura\Core\BusinessLogic\AdminAPI\GeneralSettings\GeneralSettingsController; | |
| 11 | -use SeQura\Core\BusinessLogic\AdminAPI\PromotionalWidgets\PromotionalWidgetsController; | |
| 12 | 10 | use SeQura\Core\BusinessLogic\BootstrapComponent; |
| 13 | 11 | use SeQura\Core\BusinessLogic\DataAccess\ConnectionData\Entities\ConnectionData; |
| 14 | 12 | use SeQura\Core\BusinessLogic\DataAccess\OrderSettings\Entities\OrderStatusSettings; |
| 15 | 13 | use SeQura\Core\BusinessLogic\DataAccess\PromotionalWidgets\Entities\WidgetSettings; |
| @@ -16,30 +14,31 @@ | ||
| 16 | 14 | use SeQura\Core\BusinessLogic\DataAccess\SendReport\Entities\SendReport; |
| 17 | 15 | use SeQura\Core\BusinessLogic\DataAccess\StatisticalData\Entities\StatisticalData; |
| 18 | 16 | use SeQura\Core\BusinessLogic\DataAccess\TransactionLog\Entities\TransactionLog; |
| 19 | 17 | use SeQura\Core\BusinessLogic\DataAccess\CountryConfiguration\Entities\CountryConfiguration; |
| 18 | +use SeQura\Core\BusinessLogic\DataAccess\Credentials\Entities\Credentials; | |
| 19 | +use SeQura\Core\BusinessLogic\DataAccess\Deployments\Entities\Deployment; | |
| 20 | 20 | use SeQura\Core\BusinessLogic\DataAccess\GeneralSettings\Entities\GeneralSettings; |
| 21 | +use SeQura\Core\BusinessLogic\DataAccess\PaymentMethod\Entities\PaymentMethod; | |
| 22 | +use SeQura\Core\BusinessLogic\Domain\Connection\Services\ConnectionService; | |
| 23 | +use SeQura\Core\BusinessLogic\Domain\Connection\Services\CredentialsService; | |
| 21 | 24 | use SeQura\Core\BusinessLogic\Domain\CountryConfiguration\RepositoryContracts\CountryConfigurationRepositoryInterface; |
| 22 | -use SeQura\Core\BusinessLogic\Domain\GeneralSettings\RepositoryContracts\GeneralSettingsRepositoryInterface; | |
| 23 | -use SeQura\Core\BusinessLogic\Domain\GeneralSettings\Services\CategoryService; | |
| 24 | -use SeQura\Core\BusinessLogic\Domain\GeneralSettings\Services\GeneralSettingsService; | |
| 25 | 25 | use SeQura\Core\BusinessLogic\Domain\Integration\Category\CategoryServiceInterface; |
| 26 | 26 | use SeQura\Core\BusinessLogic\Domain\Integration\Disconnect\DisconnectServiceInterface; |
| 27 | +use SeQura\Core\BusinessLogic\Domain\Integration\Order\MerchantDataProviderInterface; | |
| 28 | +use SeQura\Core\BusinessLogic\Domain\Integration\Order\OrderCreationInterface; | |
| 27 | 29 | use SeQura\Core\BusinessLogic\Domain\Integration\OrderReport\OrderReportServiceInterface; |
| 30 | +use SeQura\Core\BusinessLogic\Domain\Integration\Product\ProductServiceInterface; | |
| 28 | 31 | use SeQura\Core\BusinessLogic\Domain\Integration\SellingCountries\SellingCountriesServiceInterface; |
| 29 | 32 | use SeQura\Core\BusinessLogic\Domain\Integration\ShopOrderStatuses\ShopOrderStatusesServiceInterface; |
| 30 | 33 | use SeQura\Core\BusinessLogic\Domain\Integration\Store\StoreServiceInterface; |
| 31 | 34 | use SeQura\Core\BusinessLogic\Domain\Integration\Version\VersionServiceInterface; |
| 32 | 35 | use SeQura\Core\BusinessLogic\Domain\Multistore\StoreContext; |
| 33 | -use SeQura\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\AbstractItemFactory; | |
| 34 | 36 | use SeQura\Core\BusinessLogic\Domain\Order\Models\SeQuraOrder; |
| 35 | 37 | use SeQura\Core\BusinessLogic\Domain\Order\RepositoryContracts\SeQuraOrderRepositoryInterface; |
| 36 | 38 | use SeQura\Core\BusinessLogic\Domain\OrderStatusSettings\RepositoryContracts\OrderStatusSettingsRepositoryInterface; |
| 37 | 39 | use SeQura\Core\BusinessLogic\Domain\OrderStatusSettings\Services\OrderStatusSettingsService; |
| 38 | -use SeQura\Core\BusinessLogic\Domain\PromotionalWidgets\RepositoryContracts\WidgetSettingsRepositoryInterface; | |
| 39 | -use SeQura\Core\BusinessLogic\Domain\PromotionalWidgets\Services\WidgetSettingsService; | |
| 40 | 40 | use SeQura\Core\BusinessLogic\Domain\StatisticalData\RepositoryContracts\StatisticalDataRepositoryInterface; |
| 41 | -use SeQura\Core\BusinessLogic\Domain\Stores\Services\StoreService; | |
| 42 | 41 | use SeQura\Core\BusinessLogic\Utility\EncryptorInterface; |
| 43 | 42 | use SeQura\Core\BusinessLogic\Webhook\Services\ShopOrderService; |
| 44 | 43 | use SeQura\Core\Infrastructure\Configuration\ConfigEntity; |
| 45 | 44 | use SeQura\Core\Infrastructure\Exceptions\ServiceNotRegisteredException; |
| @@ -70,12 +69,10 @@ | ||
| 70 | 69 | use SeQura\WC\Controllers\Rest\General_Settings_REST_Controller; |
| 71 | 70 | use SeQura\WC\Controllers\Rest\Log_REST_Controller; |
| 72 | 71 | use SeQura\WC\Controllers\Rest\Onboarding_REST_Controller; |
| 73 | 72 | use SeQura\WC\Controllers\Rest\Payment_REST_Controller; |
| 74 | -use SeQura\WC\Core\BusinessLogic\Domain\Order\Models\OrderRequest\Item\Item_Factory; | |
| 75 | 73 | use SeQura\WC\Core\Extension\BusinessLogic\Domain\Order\Builders\Interface_Create_Order_Request_Builder; |
| 76 | 74 | use SeQura\WC\Core\Extension\BusinessLogic\Domain\OrderStatusSettings\Services\Order_Status_Settings_Service; |
| 77 | -use SeQura\WC\Core\Extension\Infrastructure\Configuration\Configuration; | |
| 78 | 75 | use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\Category\Category_Service; |
| 79 | 76 | use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\Disconnect\Disconnect_Service; |
| 80 | 77 | use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\ShopOrderStatuses\Shop_Order_Status_Service; |
| 81 | 78 | use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Order\Builders\Create_Order_Request_Builder; |
| @@ -82,13 +79,8 @@ | ||
| 82 | 79 | use SeQura\WC\Core\Implementation\BusinessLogic\Utility\Encryptor; |
| 83 | 80 | use SeQura\WC\Core\Implementation\BusinessLogic\Webhook\Services\Shop_Order_Service; |
| 84 | 81 | use SeQura\WC\Core\Implementation\Infrastructure\Logger\Interfaces\Default_Logger_Adapter; |
| 85 | 82 | use SeQura\WC\Core\Implementation\Infrastructure\Logger\Interfaces\Shop_Logger_Adapter; |
| 86 | -use SeQura\WC\Core\Extension\BusinessLogic\AdminAPI\GeneralSettings\General_Settings_Controller; | |
| 87 | -use SeQura\WC\Core\Extension\BusinessLogic\AdminAPI\PromotionalWidgets\Promotional_Widgets_Controller; | |
| 88 | -use SeQura\WC\Core\Extension\BusinessLogic\DataAccess\GeneralSettings\Repositories\General_Settings_Repository; | |
| 89 | -use SeQura\WC\Core\Extension\BusinessLogic\DataAccess\PaymentMethods\Entities\Payment_Methods; | |
| 90 | -use SeQura\WC\Core\Extension\BusinessLogic\DataAccess\PromotionalWidgets\Repositories\Widget_Settings_Repository; | |
| 91 | 83 | use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\OrderReport\Order_Report_Service; |
| 92 | 84 | use SeQura\WC\Repositories\Entity_Repository; |
| 93 | 85 | use SeQura\WC\Repositories\Migrations\Migration_Install_300; |
| 94 | 86 | use SeQura\WC\Repositories\Migrations\Migration_Install_320; |
| @@ -94,13 +86,11 @@ | ||
| 94 | 86 | use SeQura\WC\Repositories\Migrations\Migration_Install_320; |
| 95 | 87 | use SeQura\WC\Repositories\Queue_Item_Repository; |
| 96 | 88 | use SeQura\WC\Repositories\Repository; |
| 97 | 89 | use SeQura\WC\Repositories\SeQura_Order_Repository; |
| 98 | -use SeQura\WC\Services\Assets\Assets; | |
| 99 | -use SeQura\WC\Services\Assets\Interface_Assets; | |
| 100 | 90 | use SeQura\WC\Services\Cart\Cart_Service; |
| 101 | 91 | use SeQura\WC\Services\Cart\Interface_Cart_Service; |
| 102 | -use SeQura\WC\Services\Constants; | |
| 92 | +use SeQura\WC\Services\Constants\Constants; | |
| 103 | 93 | use SeQura\WC\Services\Core\Selling_Countries_Service; |
| 104 | 94 | use SeQura\WC\Services\Core\Store_Service; |
| 105 | 95 | use SeQura\WC\Services\Core\Version_Service; |
| 106 | 96 | use SeQura\WC\Services\Shopper\Shopper_Service; |
| @@ -106,33 +96,57 @@ | ||
| 106 | 96 | use SeQura\WC\Services\Shopper\Shopper_Service; |
| 107 | 97 | use SeQura\WC\Services\Shopper\Interface_Shopper_Service; |
| 108 | 98 | use SeQura\WC\Services\I18n\I18n; |
| 109 | 99 | use SeQura\WC\Services\I18n\Interface_I18n; |
| 110 | -use SeQura\WC\Services\Interface_Log_File; | |
| 111 | -use SeQura\WC\Services\Interface_Logger_Service; | |
| 112 | -use SeQura\WC\Services\Log_File; | |
| 113 | -use SeQura\WC\Services\Logger_Service; | |
| 100 | +use SeQura\WC\Services\Log\Interface_Log_File; | |
| 101 | +use SeQura\WC\Services\Log\Interface_Logger_Service; | |
| 102 | +use SeQura\WC\Services\Log\Log_File; | |
| 103 | +use SeQura\WC\Services\Log\Logger_Service; | |
| 114 | 104 | use SeQura\WC\Services\Migration\Interface_Migration_Manager; |
| 115 | 105 | use SeQura\WC\Services\Migration\Migration_Manager; |
| 116 | 106 | use SeQura\WC\Services\Order\Interface_Order_Service; |
| 117 | 107 | use SeQura\WC\Services\Order\Order_Service; |
| 118 | 108 | use SeQura\WC\Services\Payment\Interface_Payment_Method_Service; |
| 119 | -use SeQura\WC\Services\Payment\Interface_Payment_Service; | |
| 120 | 109 | use SeQura\WC\Services\Payment\Payment_Method_Service; |
| 121 | -use SeQura\WC\Services\Payment\Payment_Service; | |
| 122 | 110 | use SeQura\WC\Services\Payment\Sequra_Payment_Gateway_Block_Support; |
| 123 | 111 | use SeQura\WC\Services\Pricing\Interface_Pricing_Service; |
| 124 | 112 | use SeQura\WC\Services\Pricing\Pricing_Service; |
| 125 | 113 | use SeQura\WC\Services\Product\Interface_Product_Service; |
| 126 | 114 | use SeQura\WC\Services\Product\Product_Service; |
| 127 | -use SeQura\WC\Services\Regex\Interface_Regex; | |
| 128 | -use SeQura\WC\Services\Regex\Regex; | |
| 129 | 115 | use SeQura\WC\Services\Report\Interface_Report_Service; |
| 130 | 116 | use SeQura\WC\Services\Report\Report_Service; |
| 131 | -use SeQura\WC\Services\Interface_Constants; | |
| 117 | +use SeQura\WC\Services\Constants\Interface_Constants; | |
| 132 | 118 | use SeQura\WC\Services\Time\Interface_Time_Checker_Service; |
| 133 | 119 | use SeQura\WC\Services\Time\Time_Checker_Service; |
| 134 | -use SeQura\WC\Repositories\Interface_Deletable_Repository; | |
| 120 | +use SeQura\Core\BusinessLogic\Domain\Integration\PromotionalWidgets\WidgetConfiguratorInterface; | |
| 121 | +use SeQura\Core\BusinessLogic\Domain\Integration\PromotionalWidgets\MiniWidgetMessagesProviderInterface; | |
| 122 | +use SeQura\Core\BusinessLogic\Domain\Order\Builders\MerchantOrderRequestBuilder; | |
| 123 | +use SeQura\Core\BusinessLogic\Domain\Order\Service\OrderService; | |
| 124 | +use SeQura\Core\Infrastructure\Configuration\Configuration; | |
| 125 | +use SeQura\Core\Infrastructure\Utility\RegexProvider; | |
| 126 | +use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\Order\Merchant_Data_Provider; | |
| 127 | +use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\Order\Order_Creation; | |
| 128 | +use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\Product\Product_Service as Core_Product_Service; | |
| 129 | +use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\PromotionalWidgets\Mini_Widget_Messages_Provider; | |
| 130 | +use SeQura\WC\Core\Implementation\BusinessLogic\Domain\Integration\PromotionalWidgets\Widget_Configurator; | |
| 131 | +use SeQura\WC\Repositories\Migrations\Migration_Install_400; | |
| 132 | +use SeQura\WC\Services\Order\Current_Order_Provider; | |
| 133 | +use SeQura\WC\Services\Order\Interface_Current_Order_Provider; | |
| 134 | +use SeQura\WC\Services\Platform\Interface_Platform_Provider; | |
| 135 | +use SeQura\WC\Services\Platform\Platform_Provider; | |
| 136 | +use SeQura\WC\Services\Widgets\Interface_Widgets_Service; | |
| 137 | +use SeQura\WC\Services\Widgets\Widgets_Service; | |
| 138 | +use SeQura\Core\BusinessLogic\Domain\Integration\Store\StoreIdProvider; | |
| 139 | +use SeQura\Core\Infrastructure\Configuration\ConfigurationManager; | |
| 140 | +use SeQura\WC\Core\Extension\BusinessLogic\Domain\Integration\Store\Store_Id_Provider; | |
| 141 | +use SeQura\WC\Services\Order\Builder\Interface_Order_Address_Builder; | |
| 142 | +use SeQura\WC\Services\Order\Builder\Order_Address_Builder; | |
| 143 | +use SeQura\WC\Services\Order\Builder\Interface_Order_Customer_Builder; | |
| 144 | +use SeQura\WC\Services\Order\Builder\Interface_Order_Delivery_Method_Builder; | |
| 145 | +use SeQura\WC\Services\Order\Builder\Order_Customer_Builder; | |
| 146 | +use SeQura\WC\Services\Order\Builder\Order_Delivery_Method_Builder; | |
| 147 | +use SeQura\WC\Services\Service\Interface_Settings_Service; | |
| 148 | +use SeQura\WC\Services\Service\Settings_Service; | |
| 135 | 149 | |
| 136 | 150 | /** |
| 137 | 151 | * Implementation for the core bootstrap class. |
| 138 | 152 | */ |
| @@ -289,50 +303,58 @@ | ||
| 289 | 303 | static function () { |
| 290 | 304 | return Reg::getService( Order_Status_Settings_Service::class ); |
| 291 | 305 | } |
| 292 | 306 | ); |
| 307 | + // Extend Configuration. | |
| 293 | 308 | Reg::registerService( |
| 294 | 309 | Configuration::class, |
| 295 | 310 | static function () { |
| 296 | 311 | if ( ! isset( self::$cache[ Configuration::class ] ) ) { |
| 297 | - self::$cache[ Configuration::class ] = Configuration::getInstance(); | |
| 312 | + self::$cache[ Configuration::class ] = \SeQura\WC\Core\Extension\Infrastructure\Configuration\Configuration::getInstance(); | |
| 298 | 313 | } |
| 299 | 314 | return self::$cache[ Configuration::class ]; |
| 300 | 315 | } |
| 301 | 316 | ); |
| 317 | + | |
| 318 | + /** | |
| 319 | + * Initialize StoreContext with default store ID so any service that depends on StoreContext | |
| 320 | + * will have the correct store ID set from the beginning. This will reduce the StoreContext::doWithStore | |
| 321 | + * calls to the cases where it's really necessary to set a different store ID. | |
| 322 | + */ | |
| 302 | 323 | Reg::registerService( |
| 303 | - \SeQura\Core\Infrastructure\Configuration\Configuration::CLASS_NAME, | |
| 324 | + StoreIdProvider::class, | |
| 304 | 325 | static function () { |
| 305 | - return Reg::getService( Configuration::class ); | |
| 326 | + if ( ! isset( self::$cache[ StoreIdProvider::class ] ) ) { | |
| 327 | + self::$cache[ StoreIdProvider::class ] = new Store_Id_Provider(); | |
| 328 | + } | |
| 329 | + return self::$cache[ StoreIdProvider::class ]; | |
| 306 | 330 | } |
| 307 | 331 | ); |
| 332 | + | |
| 308 | 333 | Reg::registerService( |
| 309 | 334 | Interface_Create_Order_Request_Builder::class, |
| 310 | 335 | static function () { |
| 311 | 336 | if ( ! isset( self::$cache[ Interface_Create_Order_Request_Builder::class ] ) ) { |
| 312 | 337 | self::$cache[ Interface_Create_Order_Request_Builder::class ] = new Create_Order_Request_Builder( |
| 313 | - Reg::getService( Interface_Payment_Service::class ), | |
| 314 | 338 | Reg::getService( Interface_Cart_Service::class ), |
| 315 | - Reg::getService( Configuration::class ), | |
| 339 | + Reg::getService( Interface_Platform_Provider::class ), | |
| 316 | 340 | Reg::getService( Interface_Product_Service::class ), |
| 317 | 341 | Reg::getService( Interface_Order_Service::class ), |
| 318 | 342 | Reg::getService( Interface_I18n::class ), |
| 319 | 343 | Reg::getService( Interface_Shopper_Service::class ), |
| 320 | - Reg::getService( Interface_Logger_Service::class ) | |
| 344 | + Reg::getService( Interface_Logger_Service::class ), | |
| 345 | + Reg::getService( Interface_Current_Order_Provider::class ), | |
| 346 | + Reg::getService( MerchantOrderRequestBuilder::class ), | |
| 347 | + Reg::getService( Interface_Order_Delivery_Method_Builder::class ), | |
| 348 | + Reg::getService( Interface_Order_Address_Builder::class ), | |
| 349 | + Reg::getService( Interface_Order_Customer_Builder::class ), | |
| 350 | + Reg::getService( CredentialsService::class ), | |
| 351 | + Reg::getService( SeQuraOrderRepositoryInterface::class ) | |
| 321 | 352 | ); |
| 322 | 353 | } |
| 323 | 354 | return self::$cache[ Interface_Create_Order_Request_Builder::class ]; |
| 324 | 355 | } |
| 325 | 356 | ); |
| 326 | - Reg::registerService( | |
| 327 | - AbstractItemFactory::class, | |
| 328 | - static function () { | |
| 329 | - if ( ! isset( self::$cache[ AbstractItemFactory::class ] ) ) { | |
| 330 | - self::$cache[ AbstractItemFactory::class ] = new Item_Factory(); | |
| 331 | - } | |
| 332 | - return self::$cache[ AbstractItemFactory::class ]; | |
| 333 | - } | |
| 334 | - ); | |
| 335 | 357 | |
| 336 | 358 | // Core Implementation. |
| 337 | 359 | Reg::registerService( |
| 338 | 360 | EncryptorInterface::class, |
| @@ -352,10 +374,8 @@ | ||
| 352 | 374 | RepositoryRegistry::getRepository( ConnectionData::class ), |
| 353 | 375 | RepositoryRegistry::getRepository( StatisticalData::class ), |
| 354 | 376 | RepositoryRegistry::getRepository( SendReport::class ), |
| 355 | 377 | RepositoryRegistry::getRepository( QueueItem::class ), |
| 356 | - //phpcs:ignore | |
| 357 | - // RepositoryRegistry::getRepository( SeQuraOrder::class ), | |
| 358 | 378 | ) |
| 359 | 379 | ); |
| 360 | 380 | } |
| 361 | 381 | return self::$cache[ DisconnectServiceInterface::class ]; |
| @@ -365,18 +385,46 @@ | ||
| 365 | 385 | OrderReportServiceInterface::class, |
| 366 | 386 | static function () { |
| 367 | 387 | if ( ! isset( self::$cache[ OrderReportServiceInterface::class ] ) ) { |
| 368 | 388 | self::$cache[ OrderReportServiceInterface::class ] = new Order_Report_Service( |
| 369 | - Reg::getService( Configuration::CLASS_NAME ), | |
| 389 | + Reg::getService( Interface_Platform_Provider::class ), | |
| 370 | 390 | Reg::getService( Interface_Pricing_Service::class ), |
| 371 | 391 | Reg::getService( Interface_Cart_Service::class ), |
| 372 | 392 | Reg::getService( Interface_Order_Service::class ), |
| 373 | - Reg::getService( Interface_I18n::class ) | |
| 393 | + Reg::getService( Interface_I18n::class ), | |
| 394 | + Reg::getService( Interface_Order_Delivery_Method_Builder::class ), | |
| 395 | + Reg::getService( Interface_Order_Address_Builder::class ), | |
| 396 | + Reg::getService( Interface_Order_Customer_Builder::class ) | |
| 374 | 397 | ); |
| 375 | 398 | } |
| 376 | 399 | return self::$cache[ OrderReportServiceInterface::class ]; |
| 377 | 400 | } |
| 378 | 401 | ); |
| 402 | + Reg::registerService( | |
| 403 | + MerchantDataProviderInterface::class, | |
| 404 | + static function () { | |
| 405 | + if ( ! isset( self::$cache[ MerchantDataProviderInterface::class ] ) ) { | |
| 406 | + self::$cache[ MerchantDataProviderInterface::class ] = new Merchant_Data_Provider( | |
| 407 | + Reg::getService( Interface_Current_Order_Provider::class ), | |
| 408 | + Reg::getService( Interface_Constants::class ), | |
| 409 | + Reg::getService( Interface_Product_Service::class ), | |
| 410 | + Reg::getService( Interface_Cart_Service::class ), | |
| 411 | + Reg::getService( Interface_Shopper_Service::class ), | |
| 412 | + Reg::getService( StoreContext::class ) | |
| 413 | + ); | |
| 414 | + } | |
| 415 | + return self::$cache[ MerchantDataProviderInterface::class ]; | |
| 416 | + } | |
| 417 | + ); | |
| 418 | + Reg::registerService( | |
| 419 | + OrderCreationInterface::class, | |
| 420 | + static function () { | |
| 421 | + if ( ! isset( self::$cache[ OrderCreationInterface::class ] ) ) { | |
| 422 | + self::$cache[ OrderCreationInterface::class ] = new Order_Creation(); | |
| 423 | + } | |
| 424 | + return self::$cache[ OrderCreationInterface::class ]; | |
| 425 | + } | |
| 426 | + ); | |
| 379 | 427 | |
| 380 | 428 | |
| 381 | 429 | Reg::registerService( |
| 382 | 430 | Serializer::class, |
| @@ -461,9 +509,10 @@ | ||
| 461 | 509 | Interface_Log_File::class, |
| 462 | 510 | static function () { |
| 463 | 511 | if ( ! isset( self::$cache[ Interface_Log_File::class ] ) ) { |
| 464 | 512 | self::$cache[ Interface_Log_File::class ] = new Log_File( |
| 465 | - self::get_constants()->get_plugin_log_file_path() | |
| 513 | + self::get_constants()->get_plugin_log_file_path(), | |
| 514 | + Reg::getService( StoreContext::class ) | |
| 466 | 515 | ); |
| 467 | 516 | } |
| 468 | 517 | return self::$cache[ Interface_Log_File::class ]; |
| 469 | 518 | } |
| @@ -471,9 +520,9 @@ | ||
| 471 | 520 | Reg::registerService( |
| 472 | 521 | Interface_Migration_Manager::class, |
| 473 | 522 | static function () { |
| 474 | 523 | if ( ! isset( self::$cache[ Interface_Migration_Manager::class ] ) ) { |
| 475 | - $configuration = Reg::getService( Configuration::CLASS_NAME ); | |
| 524 | + $configuration = Reg::getService( ConfigurationManager::CLASS_NAME ); | |
| 476 | 525 | $wpdb = Reg::getService( \wpdb::class ); |
| 477 | 526 | /** |
| 478 | 527 | * Order repository. |
| 479 | 528 | * |
| @@ -492,9 +541,22 @@ | ||
| 492 | 541 | * |
| 493 | 542 | * @var Repository $queue_item_repository |
| 494 | 543 | */ |
| 495 | 544 | $queue_item_repository = RepositoryRegistry::getRepository( QueueItem::class ); |
| 545 | + /** | |
| 546 | + * Encryptor service. | |
| 547 | + * | |
| 548 | + * @var EncryptorInterface $encryptor | |
| 549 | + */ | |
| 550 | + $encryptor = Reg::getService( EncryptorInterface::class ); | |
| 496 | 551 | |
| 552 | + /** | |
| 553 | + * Store context service. | |
| 554 | + * | |
| 555 | + * @var StoreContext $store_context | |
| 556 | + */ | |
| 557 | + $store_context = Reg::getService( StoreContext::class ); | |
| 558 | + | |
| 497 | 559 | self::$cache[ Interface_Migration_Manager::class ] = new Migration_Manager( |
| 498 | 560 | self::get_constants()->get_plugin_basename(), |
| 499 | 561 | $configuration, |
| 500 | 562 | self::get_constants()->get_plugin_data()['Version'], |
| @@ -500,20 +562,24 @@ | ||
| 500 | 562 | self::get_constants()->get_plugin_data()['Version'], |
| 501 | 563 | array( |
| 502 | 564 | new Migration_Install_300( |
| 503 | 565 | $wpdb, |
| 504 | - $configuration, | |
| 505 | 566 | $order_repository, |
| 506 | 567 | $entity_repository, |
| 507 | - $queue_item_repository | |
| 568 | + $queue_item_repository, | |
| 569 | + $store_context | |
| 508 | 570 | ), |
| 509 | 571 | new Migration_Install_320( |
| 510 | 572 | $wpdb, |
| 511 | - $configuration, | |
| 512 | 573 | self::get_constants()->get_hook_add_order_indexes(), |
| 513 | 574 | $entity_repository, |
| 514 | 575 | $queue_item_repository |
| 515 | 576 | ), |
| 577 | + new Migration_Install_400( | |
| 578 | + $wpdb, | |
| 579 | + $encryptor, | |
| 580 | + $store_context, | |
| 581 | + ), | |
| 516 | 582 | ) |
| 517 | 583 | ); |
| 518 | 584 | } |
| 519 | 585 | return self::$cache[ Interface_Migration_Manager::class ]; |
| @@ -528,28 +594,16 @@ | ||
| 528 | 594 | return self::$cache[ Interface_I18n::class ]; |
| 529 | 595 | } |
| 530 | 596 | ); |
| 531 | 597 | Reg::registerService( |
| 532 | - Interface_Regex::class, | |
| 533 | - static function () { | |
| 534 | - if ( ! isset( self::$cache[ Interface_Regex::class ] ) ) { | |
| 535 | - self::$cache[ Interface_Regex::class ] = new Regex(); | |
| 536 | - } | |
| 537 | - return self::$cache[ Interface_Regex::class ]; | |
| 538 | - } | |
| 539 | - ); | |
| 540 | - Reg::registerService( | |
| 541 | 598 | Interface_Report_Service::class, |
| 542 | 599 | static function () { |
| 543 | 600 | if ( ! isset( self::$cache[ Interface_Report_Service::class ] ) ) { |
| 544 | 601 | self::$cache[ Interface_Report_Service::class ] = new Report_Service( |
| 545 | - Reg::getService( Configuration::class ), | |
| 546 | - Reg::getService( StoreService::class ), | |
| 547 | 602 | Reg::getService( ShopOrderService::class ), |
| 548 | 603 | Reg::getService( StatisticalDataRepositoryInterface::class ), |
| 549 | 604 | Reg::getService( CountryConfigurationRepositoryInterface::class ), |
| 550 | - Reg::getService( Interface_Order_Service::class ), | |
| 551 | - Reg::getService( StoreContext::class ) | |
| 605 | + Reg::getService( Interface_Order_Service::class ) | |
| 552 | 606 | ); |
| 553 | 607 | } |
| 554 | 608 | return self::$cache[ Interface_Report_Service::class ]; |
| 555 | 609 | } |
| @@ -565,20 +619,8 @@ | ||
| 565 | 619 | } |
| 566 | 620 | return self::$cache[ Interface_Logger_Service::class ]; |
| 567 | 621 | } |
| 568 | 622 | ); |
| 569 | - Reg::registerService( | |
| 570 | - Interface_Payment_Service::class, | |
| 571 | - static function () { | |
| 572 | - if ( ! isset( self::$cache[ Interface_Payment_Service::class ] ) ) { | |
| 573 | - self::$cache[ Interface_Payment_Service::class ] = new Payment_Service( | |
| 574 | - Reg::getService( Configuration::class ), | |
| 575 | - Reg::getService( Interface_I18n::class ) | |
| 576 | - ); | |
| 577 | - } | |
| 578 | - return self::$cache[ Interface_Payment_Service::class ]; | |
| 579 | - } | |
| 580 | - ); | |
| 581 | 623 | |
| 582 | 624 | Reg::registerService( |
| 583 | 625 | Sequra_Payment_Gateway_Block_Support::class, |
| 584 | 626 | static function () { |
| @@ -613,18 +655,18 @@ | ||
| 613 | 655 | $repository = RepositoryRegistry::getRepository( SeQuraOrder::class ); |
| 614 | 656 | |
| 615 | 657 | self::$cache[ Interface_Order_Service::class ] = new Order_Service( |
| 616 | 658 | Reg::getService( SeQuraOrderRepositoryInterface::class ), |
| 617 | - Reg::getService( Interface_Payment_Service::class ), | |
| 618 | 659 | Reg::getService( Interface_Pricing_Service::class ), |
| 619 | 660 | Reg::getService( OrderStatusSettingsService::class ), |
| 620 | - Reg::getService( Configuration::class ), | |
| 621 | 661 | Reg::getService( Interface_Cart_Service::class ), |
| 622 | - Reg::getService( StoreContext::class ), | |
| 623 | 662 | Reg::getService( Interface_Logger_Service::class ), |
| 624 | 663 | Reg::getService( Interface_Time_Checker_Service::class ), |
| 625 | 664 | $repository, |
| 626 | - $repository | |
| 665 | + $repository, | |
| 666 | + self::get_constants()->get_payment_gateway_id(), | |
| 667 | + Reg::getService( ConnectionService::class ), | |
| 668 | + Reg::getService( OrderService::class ) | |
| 627 | 669 | ); |
| 628 | 670 | } |
| 629 | 671 | return self::$cache[ Interface_Order_Service::class ]; |
| 630 | 672 | } |
| @@ -634,11 +676,11 @@ | ||
| 634 | 676 | static function () { |
| 635 | 677 | if ( ! isset( self::$cache[ Interface_Cart_Service::class ] ) ) { |
| 636 | 678 | self::$cache[ Interface_Cart_Service::class ] = new Cart_Service( |
| 637 | 679 | Reg::getService( Interface_Product_Service::class ), |
| 638 | - Reg::getService( Configuration::class ), | |
| 639 | 680 | Reg::getService( Interface_Pricing_Service::class ), |
| 640 | - Reg::getService( Interface_Logger_Service::class ) | |
| 681 | + Reg::getService( Interface_Logger_Service::class ), | |
| 682 | + Reg::getService( Interface_Shopper_Service::class ) | |
| 641 | 683 | ); |
| 642 | 684 | } |
| 643 | 685 | return self::$cache[ Interface_Cart_Service::class ]; |
| 644 | 686 | } |
| @@ -647,11 +689,11 @@ | ||
| 647 | 689 | Interface_Product_Service::class, |
| 648 | 690 | static function () { |
| 649 | 691 | if ( ! isset( self::$cache[ Interface_Product_Service::class ] ) ) { |
| 650 | 692 | self::$cache[ Interface_Product_Service::class ] = new Product_Service( |
| 651 | - Reg::getService( Configuration::class ), | |
| 652 | 693 | Reg::getService( Interface_Pricing_Service::class ), |
| 653 | - Reg::getService( Interface_Regex::class ) | |
| 694 | + Reg::getService( RegexProvider::class ), | |
| 695 | + Reg::getService( StoreContext::class ) | |
| 654 | 696 | ); |
| 655 | 697 | } |
| 656 | 698 | return self::$cache[ Interface_Product_Service::class ]; |
| 657 | 699 | } |
| @@ -659,9 +701,11 @@ | ||
| 659 | 701 | Reg::registerService( |
| 660 | 702 | Interface_Shopper_Service::class, |
| 661 | 703 | static function () { |
| 662 | 704 | if ( ! isset( self::$cache[ Interface_Shopper_Service::class ] ) ) { |
| 663 | - self::$cache[ Interface_Shopper_Service::class ] = new Shopper_Service(); | |
| 705 | + self::$cache[ Interface_Shopper_Service::class ] = new Shopper_Service( | |
| 706 | + Reg::getService( StoreContext::class ) | |
| 707 | + ); | |
| 664 | 708 | } |
| 665 | 709 | return self::$cache[ Interface_Shopper_Service::class ]; |
| 666 | 710 | } |
| 667 | 711 | ); |
| @@ -671,9 +715,11 @@ | ||
| 671 | 715 | if ( ! isset( self::$cache[ ShopOrderService::class ] ) ) { |
| 672 | 716 | self::$cache[ ShopOrderService::class ] = new Shop_Order_Service( |
| 673 | 717 | Reg::getService( SeQuraOrderRepositoryInterface::class ), |
| 674 | 718 | Reg::getService( Interface_Logger_Service::class ), |
| 675 | - Reg::getService( Interface_Create_Order_Request_Builder::class ) | |
| 719 | + Reg::getService( Interface_Create_Order_Request_Builder::class ), | |
| 720 | + Reg::getService( Interface_Current_Order_Provider::class ), | |
| 721 | + Reg::getService( OrderService::class ) | |
| 676 | 722 | ); |
| 677 | 723 | } |
| 678 | 724 | return self::$cache[ ShopOrderService::class ]; |
| 679 | 725 | } |
| @@ -678,25 +724,145 @@ | ||
| 678 | 724 | return self::$cache[ ShopOrderService::class ]; |
| 679 | 725 | } |
| 680 | 726 | ); |
| 681 | 727 | Reg::registerService( |
| 682 | - Interface_Assets::class, | |
| 728 | + Interface_Time_Checker_Service::class, | |
| 683 | 729 | static function () { |
| 684 | - if ( ! isset( self::$cache[ Interface_Assets::class ] ) ) { | |
| 685 | - self::$cache[ Interface_Assets::class ] = new Assets(); | |
| 730 | + if ( ! isset( self::$cache[ Interface_Time_Checker_Service::class ] ) ) { | |
| 731 | + self::$cache[ Interface_Time_Checker_Service::class ] = new Time_Checker_Service(); | |
| 686 | 732 | } |
| 687 | - return self::$cache[ Interface_Assets::class ]; | |
| 733 | + return self::$cache[ Interface_Time_Checker_Service::class ]; | |
| 688 | 734 | } |
| 689 | 735 | ); |
| 736 | + | |
| 690 | 737 | Reg::registerService( |
| 691 | - Interface_Time_Checker_Service::class, | |
| 738 | + ProductServiceInterface::class, | |
| 692 | 739 | static function () { |
| 693 | - if ( ! isset( self::$cache[ Interface_Time_Checker_Service::class ] ) ) { | |
| 694 | - self::$cache[ Interface_Time_Checker_Service::class ] = new Time_Checker_Service(); | |
| 740 | + if ( ! isset( self::$cache[ ProductServiceInterface::class ] ) ) { | |
| 741 | + self::$cache[ ProductServiceInterface::class ] = new Core_Product_Service(); | |
| 695 | 742 | } |
| 696 | - return self::$cache[ Interface_Time_Checker_Service::class ]; | |
| 743 | + return self::$cache[ ProductServiceInterface::class ]; | |
| 697 | 744 | } |
| 698 | 745 | ); |
| 746 | + Reg::registerService( | |
| 747 | + WidgetConfiguratorInterface::class, | |
| 748 | + static function () { | |
| 749 | + if ( ! isset( self::$cache[ WidgetConfiguratorInterface::class ] ) ) { | |
| 750 | + self::$cache[ WidgetConfiguratorInterface::class ] = new Widget_Configurator( | |
| 751 | + Reg::getService( Interface_I18n::class ) | |
| 752 | + ); | |
| 753 | + } | |
| 754 | + return self::$cache[ WidgetConfiguratorInterface::class ]; | |
| 755 | + } | |
| 756 | + ); | |
| 757 | + | |
| 758 | + Reg::registerService( | |
| 759 | + MiniWidgetMessagesProviderInterface::class, | |
| 760 | + static function () { | |
| 761 | + if ( ! isset( self::$cache[ MiniWidgetMessagesProviderInterface::class ] ) ) { | |
| 762 | + self::$cache[ MiniWidgetMessagesProviderInterface::class ] = new Mini_Widget_Messages_Provider( | |
| 763 | + Reg::getService( Interface_I18n::class ) | |
| 764 | + ); | |
| 765 | + } | |
| 766 | + return self::$cache[ MiniWidgetMessagesProviderInterface::class ]; | |
| 767 | + } | |
| 768 | + ); | |
| 769 | + | |
| 770 | + Reg::registerService( | |
| 771 | + Interface_Current_Order_Provider::class, | |
| 772 | + static function () { | |
| 773 | + if ( ! isset( self::$cache[ Interface_Current_Order_Provider::class ] ) ) { | |
| 774 | + self::$cache[ Interface_Current_Order_Provider::class ] = new Current_Order_Provider(); | |
| 775 | + } | |
| 776 | + return self::$cache[ Interface_Current_Order_Provider::class ]; | |
| 777 | + } | |
| 778 | + ); | |
| 779 | + | |
| 780 | + Reg::registerService( | |
| 781 | + Interface_Platform_Provider::class, | |
| 782 | + static function () { | |
| 783 | + if ( ! isset( self::$cache[ Interface_Platform_Provider::class ] ) ) { | |
| 784 | + self::$cache[ Interface_Platform_Provider::class ] = new Platform_Provider( | |
| 785 | + Reg::getService( Interface_Constants::class ) | |
| 786 | + ); | |
| 787 | + } | |
| 788 | + return self::$cache[ Interface_Platform_Provider::class ]; | |
| 789 | + } | |
| 790 | + ); | |
| 791 | + | |
| 792 | + Reg::registerService( | |
| 793 | + Interface_Payment_Method_Service::class, | |
| 794 | + static function () { | |
| 795 | + if ( ! isset( self::$cache[ Interface_Payment_Method_Service::class ] ) ) { | |
| 796 | + self::$cache[ Interface_Payment_Method_Service::class ] = new Payment_Method_Service( | |
| 797 | + Reg::getService( Interface_Create_Order_Request_Builder::class ), | |
| 798 | + Reg::getService( Interface_Order_Service::class ), | |
| 799 | + Reg::getService( Interface_Logger_Service::class ), | |
| 800 | + Reg::getService( Interface_Current_Order_Provider::class ), | |
| 801 | + Reg::getService( StoreContext::class ) | |
| 802 | + ); | |
| 803 | + } | |
| 804 | + return self::$cache[ Interface_Payment_Method_Service::class ]; | |
| 805 | + } | |
| 806 | + ); | |
| 807 | + | |
| 808 | + Reg::registerService( | |
| 809 | + Interface_Widgets_Service::class, | |
| 810 | + static function () { | |
| 811 | + if ( ! isset( self::$cache[ Interface_Widgets_Service::class ] ) ) { | |
| 812 | + self::$cache[ Interface_Widgets_Service::class ] = new Widgets_Service( | |
| 813 | + Reg::getService( Interface_Logger_Service::class ), | |
| 814 | + Reg::getService( Interface_I18n::class ), | |
| 815 | + Reg::getService( Interface_Shopper_Service::class ), | |
| 816 | + Reg::getService( WidgetConfiguratorInterface::class ), | |
| 817 | + Reg::getService( StoreContext::class ) | |
| 818 | + ); | |
| 819 | + } | |
| 820 | + return self::$cache[ Interface_Widgets_Service::class ]; | |
| 821 | + } | |
| 822 | + ); | |
| 823 | + Reg::registerService( | |
| 824 | + Interface_Settings_Service::class, | |
| 825 | + static function () { | |
| 826 | + if ( ! isset( self::$cache[ Interface_Settings_Service::class ] ) ) { | |
| 827 | + self::$cache[ Interface_Settings_Service::class ] = new Settings_Service(); | |
| 828 | + } | |
| 829 | + return self::$cache[ Interface_Settings_Service::class ]; | |
| 830 | + } | |
| 831 | + ); | |
| 832 | + Reg::registerService( | |
| 833 | + Interface_Order_Address_Builder::class, | |
| 834 | + static function () { | |
| 835 | + if ( ! isset( self::$cache[ Interface_Order_Address_Builder::class ] ) ) { | |
| 836 | + self::$cache[ Interface_Order_Address_Builder::class ] = new Order_Address_Builder( | |
| 837 | + Reg::getService( Interface_Shopper_Service::class ) | |
| 838 | + ); | |
| 839 | + } | |
| 840 | + return self::$cache[ Interface_Order_Address_Builder::class ]; | |
| 841 | + } | |
| 842 | + ); | |
| 843 | + Reg::registerService( | |
| 844 | + Interface_Order_Customer_Builder::class, | |
| 845 | + static function () { | |
| 846 | + if ( ! isset( self::$cache[ Interface_Order_Customer_Builder::class ] ) ) { | |
| 847 | + self::$cache[ Interface_Order_Customer_Builder::class ] = new Order_Customer_Builder( | |
| 848 | + Reg::getService( Interface_Shopper_Service::class ), | |
| 849 | + Reg::getService( OrderStatusSettingsService::class ), | |
| 850 | + Reg::getService( Interface_Pricing_Service::class ) | |
| 851 | + ); | |
| 852 | + } | |
| 853 | + return self::$cache[ Interface_Order_Customer_Builder::class ]; | |
| 854 | + } | |
| 855 | + ); | |
| 856 | + Reg::registerService( | |
| 857 | + Interface_Order_Delivery_Method_Builder::class, | |
| 858 | + static function () { | |
| 859 | + if ( ! isset( self::$cache[ Interface_Order_Delivery_Method_Builder::class ] ) ) { | |
| 860 | + self::$cache[ Interface_Order_Delivery_Method_Builder::class ] = new Order_Delivery_Method_Builder(); | |
| 861 | + } | |
| 862 | + return self::$cache[ Interface_Order_Delivery_Method_Builder::class ]; | |
| 863 | + } | |
| 864 | + ); | |
| 699 | 865 | } |
| 700 | 866 | |
| 701 | 867 | /** |
| 702 | 868 | * Initializes repositories. |
| @@ -715,30 +881,8 @@ | ||
| 715 | 881 | ); |
| 716 | 882 | |
| 717 | 883 | parent::initRepositories(); |
| 718 | 884 | |
| 719 | - // Extend GeneralSettingsRepository. | |
| 720 | - Reg::registerService( | |
| 721 | - GeneralSettingsRepositoryInterface::class, | |
| 722 | - static function () { | |
| 723 | - return new General_Settings_Repository( | |
| 724 | - RepositoryRegistry::getRepository( GeneralSettings::getClassName() ), | |
| 725 | - Reg::getService( StoreContext::class ) | |
| 726 | - ); | |
| 727 | - } | |
| 728 | - ); | |
| 729 | - | |
| 730 | - // Extend WidgetSettingsRepository. | |
| 731 | - Reg::registerService( | |
| 732 | - WidgetSettingsRepositoryInterface::class, | |
| 733 | - static function () { | |
| 734 | - return new Widget_Settings_Repository( | |
| 735 | - RepositoryRegistry::getRepository( WidgetSettings::getClassName() ), | |
| 736 | - Reg::getService( StoreContext::class ) | |
| 737 | - ); | |
| 738 | - } | |
| 739 | - ); | |
| 740 | - | |
| 741 | 885 | RepositoryRegistry::registerRepository( ConfigEntity::class, Entity_Repository::class ); |
| 742 | 886 | RepositoryRegistry::registerRepository( QueueItem::class, Queue_Item_Repository::class ); |
| 743 | 887 | RepositoryRegistry::registerRepository( Process::class, Entity_Repository::class ); |
| 744 | 888 | RepositoryRegistry::registerRepository( ConnectionData::class, Entity_Repository::class ); |
| @@ -749,9 +893,11 @@ | ||
| 749 | 893 | RepositoryRegistry::registerRepository( SeQuraOrder::class, SeQura_Order_Repository::class ); |
| 750 | 894 | RepositoryRegistry::registerRepository( WidgetSettings::class, Entity_Repository::class ); |
| 751 | 895 | RepositoryRegistry::registerRepository( SendReport::class, Entity_Repository::class ); |
| 752 | 896 | RepositoryRegistry::registerRepository( TransactionLog::class, Entity_Repository::class ); |
| 753 | - RepositoryRegistry::registerRepository( Payment_Methods::class, Entity_Repository::class ); | |
| 897 | + RepositoryRegistry::registerRepository( PaymentMethod::class, Entity_Repository::class ); | |
| 898 | + RepositoryRegistry::registerRepository( Credentials::class, Entity_Repository::class ); | |
| 899 | + RepositoryRegistry::registerRepository( Deployment::class, Entity_Repository::class ); | |
| 754 | 900 | } |
| 755 | 901 | |
| 756 | 902 | /** |
| 757 | 903 | * Initializes controllers. |
| @@ -758,29 +904,8 @@ | ||
| 758 | 904 | */ |
| 759 | 905 | protected static function initControllers(): void { |
| 760 | 906 | parent::initControllers(); |
| 761 | 907 | |
| 762 | - // Extend GeneralSettingsController. | |
| 763 | - Reg::registerService( | |
| 764 | - GeneralSettingsController::class, | |
| 765 | - static function () { | |
| 766 | - return new General_Settings_Controller( | |
| 767 | - Reg::getService( GeneralSettingsService::class ), | |
| 768 | - Reg::getService( CategoryService::class ) | |
| 769 | - ); | |
| 770 | - } | |
| 771 | - ); | |
| 772 | - | |
| 773 | - // Extend PromotionalWidgetsController. | |
| 774 | - Reg::registerService( | |
| 775 | - PromotionalWidgetsController::class, | |
| 776 | - static function () { | |
| 777 | - return new Promotional_Widgets_Controller( | |
| 778 | - Reg::getService( WidgetSettingsService::class ) | |
| 779 | - ); | |
| 780 | - } | |
| 781 | - ); | |
| 782 | - | |
| 783 | 908 | // Plugin controllers. |
| 784 | 909 | Reg::registerService( |
| 785 | 910 | Interface_I18n_Controller::class, |
| 786 | 911 | static function () { |
| @@ -809,12 +934,12 @@ | ||
| 809 | 934 | $env_data['wp_version'] ?? '', |
| 810 | 935 | Reg::getService( Interface_I18n::class ), |
| 811 | 936 | Reg::getService( Interface_Logger_Service::class ), |
| 812 | 937 | self::get_constants()->get_plugin_templates_path(), |
| 813 | - Reg::getService( Configuration::class ), | |
| 814 | - Reg::getService( Interface_Assets::class ), | |
| 938 | + Reg::getService( Interface_Settings_Service::class ), | |
| 815 | 939 | Reg::getService( Interface_Payment_Method_Service::class ), |
| 816 | - Reg::getService( Interface_Regex::class ) | |
| 940 | + Reg::getService( RegexProvider::class ), | |
| 941 | + Reg::getService( Interface_Widgets_Service::class ) | |
| 817 | 942 | ); |
| 818 | 943 | } |
| 819 | 944 | return self::$cache[ Interface_Assets_Controller::class ]; |
| 820 | 945 | } |
| @@ -824,9 +949,9 @@ | ||
| 824 | 949 | static function () { |
| 825 | 950 | if ( ! isset( self::$cache[ Interface_Settings_Controller::class ] ) ) { |
| 826 | 951 | self::$cache[ Interface_Settings_Controller::class ] = new Settings_Controller( |
| 827 | 952 | self::get_constants()->get_plugin_templates_path(), |
| 828 | - Reg::getService( Configuration::class ), | |
| 953 | + Reg::getService( Interface_Settings_Service::class ), | |
| 829 | 954 | Reg::getService( Interface_Logger_Service::class ), |
| 830 | 955 | self::get_constants()->get_plugin_basename() |
| 831 | 956 | ); |
| 832 | 957 | } |
| @@ -852,14 +977,11 @@ | ||
| 852 | 977 | if ( ! isset( self::$cache[ Interface_Product_Controller::class ] ) ) { |
| 853 | 978 | self::$cache[ Interface_Product_Controller::class ] = new Product_Controller( |
| 854 | 979 | Reg::getService( Interface_Logger_Service::class ), |
| 855 | 980 | self::get_constants()->get_plugin_templates_path(), |
| 856 | - Reg::getService( Configuration::class ), | |
| 857 | 981 | Reg::getService( Interface_Product_Service::class ), |
| 858 | - Reg::getService( Interface_Payment_Service::class ), | |
| 859 | - Reg::getService( Interface_Payment_Method_Service::class ), | |
| 860 | - Reg::getService( Interface_I18n::class ), | |
| 861 | - Reg::getService( Interface_Regex::class ) | |
| 982 | + Reg::getService( RegexProvider::class ), | |
| 983 | + Reg::getService( Interface_Widgets_Service::class ) | |
| 862 | 984 | ); |
| 863 | 985 | } |
| 864 | 986 | return self::$cache[ Interface_Product_Controller::class ]; |
| 865 | 987 | } |
| @@ -895,9 +1017,10 @@ | ||
| 895 | 1017 | static function () { |
| 896 | 1018 | if ( ! isset( self::$cache[ Onboarding_REST_Controller::class ] ) ) { |
| 897 | 1019 | self::$cache[ Onboarding_REST_Controller::class ] = new Onboarding_REST_Controller( |
| 898 | 1020 | self::get_constants()->get_plugin_rest_namespace(), |
| 899 | - Reg::getService( Interface_Logger_Service::class ) | |
| 1021 | + Reg::getService( Interface_Logger_Service::class ), | |
| 1022 | + Reg::getService( RegexProvider::class ) | |
| 900 | 1023 | ); |
| 901 | 1024 | } |
| 902 | 1025 | return self::$cache[ Onboarding_REST_Controller::class ]; |
| 903 | 1026 | } |
| @@ -908,9 +1031,9 @@ | ||
| 908 | 1031 | if ( ! isset( self::$cache[ Payment_REST_Controller::class ] ) ) { |
| 909 | 1032 | self::$cache[ Payment_REST_Controller::class ] = new Payment_REST_Controller( |
| 910 | 1033 | self::get_constants()->get_plugin_rest_namespace(), |
| 911 | 1034 | Reg::getService( Interface_Logger_Service::class ), |
| 912 | - Reg::getService( Interface_Payment_Method_Service::class ) | |
| 1035 | + Reg::getService( RegexProvider::class ) | |
| 913 | 1036 | ); |
| 914 | 1037 | } |
| 915 | 1038 | return self::$cache[ Payment_REST_Controller::class ]; |
| 916 | 1039 | } |
| @@ -920,9 +1043,11 @@ | ||
| 920 | 1043 | static function () { |
| 921 | 1044 | if ( ! isset( self::$cache[ General_Settings_REST_Controller::class ] ) ) { |
| 922 | 1045 | self::$cache[ General_Settings_REST_Controller::class ] = new General_Settings_REST_Controller( |
| 923 | 1046 | self::get_constants()->get_plugin_rest_namespace(), |
| 924 | - Reg::getService( Interface_Logger_Service::class ) | |
| 1047 | + Reg::getService( Interface_Logger_Service::class ), | |
| 1048 | + Reg::getService( RegexProvider::class ), | |
| 1049 | + Reg::getService( StoreContext::class ) | |
| 925 | 1050 | ); |
| 926 | 1051 | } |
| 927 | 1052 | return self::$cache[ General_Settings_REST_Controller::class ]; |
| 928 | 1053 | } |
| @@ -932,27 +1057,13 @@ | ||
| 932 | 1057 | static function () { |
| 933 | 1058 | if ( ! isset( self::$cache[ Log_REST_Controller::class ] ) ) { |
| 934 | 1059 | self::$cache[ Log_REST_Controller::class ] = new Log_REST_Controller( |
| 935 | 1060 | self::get_constants()->get_plugin_rest_namespace(), |
| 936 | - Reg::getService( Interface_Logger_Service::class ) | |
| 1061 | + Reg::getService( Interface_Logger_Service::class ), | |
| 1062 | + Reg::getService( RegexProvider::class ) | |
| 937 | 1063 | ); |
| 938 | 1064 | } |
| 939 | 1065 | return self::$cache[ Log_REST_Controller::class ]; |
| 940 | - } | |
| 941 | - ); | |
| 942 | - Reg::registerService( | |
| 943 | - Interface_Payment_Method_Service::class, | |
| 944 | - static function () { | |
| 945 | - if ( ! isset( self::$cache[ Interface_Payment_Method_Service::class ] ) ) { | |
| 946 | - self::$cache[ Interface_Payment_Method_Service::class ] = new Payment_Method_Service( | |
| 947 | - Reg::getService( Configuration::class ), | |
| 948 | - Reg::getService( Interface_Create_Order_Request_Builder::class ), | |
| 949 | - Reg::getService( Interface_Order_Service::class ), | |
| 950 | - Reg::getService( Interface_Logger_Service::class ), | |
| 951 | - RepositoryRegistry::getRepository( Payment_Methods::CLASS_NAME ) | |
| 952 | - ); | |
| 953 | - } | |
| 954 | - return self::$cache[ Interface_Payment_Method_Service::class ]; | |
| 955 | 1066 | } |
| 956 | 1067 | ); |
| 957 | 1068 | } |
| 958 | 1069 | } |