Skip to content

Commit

Permalink
RATESWSX-300: refactoring: move plugin-config-service to core-namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy committed Mar 22, 2024
1 parent 82526b7 commit 34ff4f1
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 66 deletions.
4 changes: 2 additions & 2 deletions src/Components/DeviceFingerprint/DfpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
namespace Ratepay\RpayPayments\Components\DeviceFingerprint;

use DateTimeInterface;
use Ratepay\RpayPayments\Components\PluginConfig\Service\ConfigService;
use Ratepay\RpayPayments\Core\Entity\Extension\OrderExtension;
use Ratepay\RpayPayments\Core\Entity\RatepayOrderDataEntity;
use Ratepay\RpayPayments\Core\PluginConfigService;
use RatePAY\Service\DeviceFingerprint;
use RuntimeException;
use Shopware\Core\Checkout\Customer\CustomerEntity;
Expand All @@ -30,7 +30,7 @@
class DfpService implements DfpServiceInterface
{
public function __construct(
private readonly ConfigService $configService,
private readonly PluginConfigService $configService,
private readonly EntityRepository $orderCustomerRepository
) {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
use Ratepay\RpayPayments\Components\DeviceFingerprint\Constraint\DfpConstraint;
use Ratepay\RpayPayments\Components\DeviceFingerprint\DfpServiceInterface;
use Ratepay\RpayPayments\Components\PaymentHandler\Event\ValidationDefinitionCollectEvent;
use Ratepay\RpayPayments\Components\PluginConfig\Service\ConfigService;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\PaymentRequestData;
use Ratepay\RpayPayments\Components\RatepayApi\Event\BuildEvent;
use Ratepay\RpayPayments\Components\RatepayApi\Service\Request\PaymentRequestService;
use Ratepay\RpayPayments\Core\Entity\Extension\OrderExtension;
use Ratepay\RpayPayments\Core\Entity\RatepayOrderDataEntity;
use Ratepay\RpayPayments\Core\PluginConfigService;
use Ratepay\RpayPayments\Util\RequestHelper;
use Shopware\Storefront\Event\RouteRequest\OrderRouteRequestEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
Expand All @@ -34,7 +34,7 @@ class DeviceFingerprintSubscriber implements EventSubscriberInterface
{
public function __construct(
private readonly DfpServiceInterface $dfpService,
private readonly ConfigService $configService,
private readonly PluginConfigService $configService,
private readonly RequestStack $requestStack
) {
}
Expand Down
30 changes: 0 additions & 30 deletions src/Components/OrderManagement/Util/LineItemUtil.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/Components/PaymentHandler/AbstractPaymentHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
use Ratepay\RpayPayments\Components\PaymentHandler\Event\PaymentFailedEvent;
use Ratepay\RpayPayments\Components\PaymentHandler\Event\PaymentSuccessfulEvent;
use Ratepay\RpayPayments\Components\PaymentHandler\Event\ValidationDefinitionCollectEvent;
use Ratepay\RpayPayments\Components\PluginConfig\Service\ConfigService;
use Ratepay\RpayPayments\Components\ProfileConfig\Exception\ProfileNotFoundException;
use Ratepay\RpayPayments\Components\ProfileConfig\Service\Search\ProfileSearchService;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\PaymentRequestData;
use Ratepay\RpayPayments\Components\RatepayApi\Service\Request\PaymentRequestService;
use Ratepay\RpayPayments\Core\PluginConfigService;
use Ratepay\RpayPayments\Exception\RatepayException;
use Ratepay\RpayPayments\Util\CriteriaHelper;
use Ratepay\RpayPayments\Util\RequestHelper;
Expand Down Expand Up @@ -59,7 +59,7 @@ public function __construct(
private readonly EntityRepository $orderRepository,
private readonly PaymentRequestService $paymentRequestService,
private readonly EventDispatcherInterface $eventDispatcher,
private readonly ConfigService $configService,
private readonly PluginConfigService $configService,
private readonly RequestStack $requestStack,
private readonly ProfileSearchService $profileSearchService
) {
Expand Down
20 changes: 0 additions & 20 deletions src/Components/PluginConfig/DependencyInjection/services.xml

This file was deleted.

4 changes: 2 additions & 2 deletions src/Components/RatepayApi/Factory/CustomerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
use RatePAY\Model\Request\SubModel\Content\Customer\BankAccount;
use RatePAY\Model\Request\SubModel\Content\Customer\Contacts;
use RatePAY\Model\Request\SubModel\Content\Customer\Contacts\Phone;
use Ratepay\RpayPayments\Components\PluginConfig\Service\ConfigService;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\AbstractRequestData;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\CheckoutOperationInterface;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\PaymentRequestData;
use Ratepay\RpayPayments\Core\PluginConfigService;
use Ratepay\RpayPayments\Util\RequestHelper;
use RuntimeException;
use Shopware\Core\Checkout\Customer\Aggregate\CustomerAddress\CustomerAddressEntity;
Expand All @@ -44,7 +44,7 @@ class CustomerFactory extends AbstractFactory
{
public function __construct(
EventDispatcherInterface $eventDispatcher,
private readonly ConfigService $configService,
private readonly PluginConfigService $configService,
private readonly EntityRepository $salutationRepository,
private readonly EntityRepository $languageRepository
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

use Exception;
use Psr\Log\LoggerInterface;
use Ratepay\RpayPayments\Components\PluginConfig\Service\ConfigService;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\OrderOperationData;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\PaymentRequestData;
use Ratepay\RpayPayments\Components\RatepayApi\Event\ResponseEvent;
use Ratepay\RpayPayments\Components\RatepayApi\Service\Request\PaymentDeliverService;
use Ratepay\RpayPayments\Components\RatepayApi\Service\Request\PaymentRequestService;
use Ratepay\RpayPayments\Core\PluginConfigService;
use Ratepay\RpayPayments\Util\CriteriaHelper;
use Shopware\Core\Checkout\Order\OrderEntity;
use Shopware\Core\Content\Product\State;
Expand All @@ -31,7 +31,7 @@ public function __construct(
private readonly PaymentDeliverService $deliverService,
private readonly LoggerInterface $logger,
private readonly EntityRepository $orderRepository,
private readonly ConfigService $configService
private readonly PluginConfigService $configService
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
namespace Ratepay\RpayPayments\Components\StateMachine\Subscriber;

use Ratepay\RpayPayments\Components\PaymentHandler\Event\PaymentSuccessfulEvent;
use Ratepay\RpayPayments\Components\PluginConfig\Service\ConfigService;
use Ratepay\RpayPayments\Core\PluginConfigService;
use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionDefinition;
use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStates;
use Shopware\Core\System\StateMachine\StateMachineRegistry;
Expand All @@ -23,7 +23,7 @@ class PaymentSuccessfulSubscriber implements EventSubscriberInterface
{
public function __construct(
private readonly StateMachineRegistry $stateMachineRegistry,
private readonly ConfigService $configService
private readonly PluginConfigService $configService
) {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@

use Exception;
use Psr\Log\LoggerInterface;
use Ratepay\RpayPayments\Components\PluginConfig\Service\ConfigService;
use Ratepay\RpayPayments\Components\RatepayApi\Dto\OrderOperationData;
use Ratepay\RpayPayments\Components\RatepayApi\Service\Request\PaymentCancelService;
use Ratepay\RpayPayments\Components\RatepayApi\Service\Request\PaymentDeliverService;
use Ratepay\RpayPayments\Components\RatepayApi\Service\Request\PaymentReturnService;
use Ratepay\RpayPayments\Core\Entity\Extension\OrderExtension;
use Ratepay\RpayPayments\Core\Entity\RatepayOrderDataEntity;
use Ratepay\RpayPayments\Core\PluginConfigService;
use Ratepay\RpayPayments\Util\CriteriaHelper;
use Ratepay\RpayPayments\Util\MethodHelper;
use Shopware\Core\Checkout\Order\Aggregate\OrderDelivery\OrderDeliveryEntity;
Expand All @@ -34,7 +34,7 @@ class TransitionSubscriber implements EventSubscriberInterface
public function __construct(
private readonly EntityRepository $orderDeliveryRepository,
private readonly EntityRepository $orderRepository,
private readonly ConfigService $configService,
private readonly PluginConfigService $configService,
private readonly PaymentDeliverService $paymentDeliverService,
private readonly PaymentCancelService $paymentCancelService,
private readonly PaymentReturnService $paymentReturnService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* file that was distributed with this source code.
*/

namespace Ratepay\RpayPayments\Components\PluginConfig\Service;
namespace Ratepay\RpayPayments\Core;

use Ratepay\RpayPayments\Components\PaymentHandler\DebitPaymentHandler;
use Ratepay\RpayPayments\Components\PaymentHandler\InstallmentPaymentHandler;
Expand All @@ -19,7 +19,7 @@
use Shopware\Core\Framework\Context;
use Shopware\Core\System\SystemConfig\SystemConfigService;

class ConfigService
class PluginConfigService
{
public function __construct(
private readonly SystemConfigService $systemConfigService
Expand Down
7 changes: 7 additions & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@
<import resource="models.xml"/>
</imports>

<services>
<service id="Ratepay\RpayPayments\Core\PluginConfigService">
<argument id="Shopware\Core\System\SystemConfig\SystemConfigService" type="service"/>
<argument>%ratepay.shopware_payment.plugin_version%</argument>
</service>
</services>

</container>

0 comments on commit 34ff4f1

Please sign in to comment.