[PaymentRequest] Move Payum commands and command handlers to PayumBundle

This commit is contained in:
Grzegorz Sadowski 2024-09-27 07:45:47 +02:00
parent c9472f3eff
commit 9e7dc44763
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
9 changed files with 27 additions and 30 deletions

View file

@ -13,8 +13,8 @@ declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\Payum;
use Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum\AuthorizePaymentRequest;
use Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\PaymentRequestCommandProviderInterface;
use Sylius\Bundle\PayumBundle\PaymentRequest\Command\AuthorizePaymentRequest;
use Sylius\Component\Payment\Model\PaymentRequestInterface;
final class AuthorizeCommandProvider implements PaymentRequestCommandProviderInterface

View file

@ -13,8 +13,8 @@ declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\Payum;
use Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum\CapturePaymentRequest;
use Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\PaymentRequestCommandProviderInterface;
use Sylius\Bundle\PayumBundle\PaymentRequest\Command\CapturePaymentRequest;
use Sylius\Component\Payment\Model\PaymentRequestInterface;
final class CaptureCommandProvider implements PaymentRequestCommandProviderInterface

View file

@ -13,8 +13,8 @@ declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\Payum;
use Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum\StatusPaymentRequest;
use Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\PaymentRequestCommandProviderInterface;
use Sylius\Bundle\PayumBundle\PaymentRequest\Command\StatusPaymentRequest;
use Sylius\Component\Payment\Model\PaymentRequestInterface;
final class StatusCommandProvider implements PaymentRequestCommandProviderInterface

View file

@ -11,7 +11,7 @@
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum;
namespace Sylius\Bundle\PayumBundle\PaymentRequest\Command;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareTrait;
@ -20,8 +20,7 @@ class AuthorizePaymentRequest implements PaymentRequestHashAwareInterface
{
use PaymentRequestHashAwareTrait;
public function __construct(
protected ?string $hash,
) {
public function __construct(protected ?string $hash)
{
}
}

View file

@ -11,7 +11,7 @@
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum;
namespace Sylius\Bundle\PayumBundle\PaymentRequest\Command;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareTrait;
@ -20,8 +20,7 @@ class CapturePaymentRequest implements PaymentRequestHashAwareInterface
{
use PaymentRequestHashAwareTrait;
public function __construct(
protected ?string $hash,
) {
public function __construct(protected ?string $hash)
{
}
}

View file

@ -11,7 +11,7 @@
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum;
namespace Sylius\Bundle\PayumBundle\PaymentRequest\Command;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareTrait;
@ -20,8 +20,7 @@ class StatusPaymentRequest implements PaymentRequestHashAwareInterface
{
use PaymentRequestHashAwareTrait;
public function __construct(
protected ?string $hash,
) {
public function __construct(protected ?string $hash)
{
}
}

View file

@ -11,7 +11,7 @@
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Payum;
namespace Sylius\Bundle\PayumBundle\PaymentRequest\CommandHandler;
use Sylius\Bundle\CoreBundle\PaymentRequest\Provider\PaymentRequestProviderInterface;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface;
@ -19,7 +19,7 @@ use Sylius\Bundle\PayumBundle\Factory\GetStatusFactoryInterface;
use Sylius\Bundle\PayumBundle\Model\GatewayConfigInterface;
use Sylius\Bundle\PayumBundle\PaymentRequest\Processor\RequestProcessorInterface;
use Sylius\Bundle\PayumBundle\PaymentRequest\Resolver\DoctrineProxyObjectResolverInterface;
use Sylius\Component\Core\Model\PaymentMethodInterface;
use Sylius\Component\Payment\Model\PaymentMethodInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
#[AsMessageHandler]

View file

@ -11,7 +11,7 @@
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Payum;
namespace Sylius\Bundle\PayumBundle\PaymentRequest\CommandHandler;
use Sylius\Bundle\CoreBundle\PaymentRequest\Provider\PaymentRequestProviderInterface;
use Sylius\Bundle\PaymentBundle\Command\PaymentRequestHashAwareInterface;

View file

@ -11,14 +11,15 @@
-->
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
<container
xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd"
>
<services>
<defaults public="true" />
<service id="Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Payum\TokenPaymentRequestHandler" abstract="true">
<service id="sylius.payum.payment_request.command_handler.token_payment_request" class="Sylius\Bundle\PayumBundle\PaymentRequest\CommandHandler\TokenPaymentRequestHandler" abstract="true">
<argument type="service" id="Sylius\Bundle\CoreBundle\PaymentRequest\Provider\PaymentRequestProviderInterface" />
<argument type="service" id="sylius.payum.payment_request.resolver.doctrine_proxy_object_resolver" />
<argument type="service" id="sylius.payum.payment_request.factory.payum_token" />
@ -26,26 +27,25 @@
<argument type="service" id="sylius.payum.payment_request.processor.after_token_request" />
</service>
<service id="sylius.payment_request.payum.capture" parent="Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Payum\TokenPaymentRequestHandler">
<service id="sylius.payum.payment_request.command_handler.token_payment_request.capture" parent="sylius.payum.payment_request.command_handler.token_payment_request">
<argument type="service" id="sylius.factory.payum_capture" />
<tag name="messenger.message_handler" bus="sylius.payment_request.command_bus" handles="Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum\CapturePaymentRequest" />
<tag name="messenger.message_handler" bus="sylius.payment_request.command_bus" handles="Sylius\Bundle\PayumBundle\PaymentRequest\Command\CapturePaymentRequest" />
</service>
<service id="sylius.payment_request.payum.authorize" parent="Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Payum\TokenPaymentRequestHandler">
<service id="sylius.payum.payment_request.command_handler.token_payment_request.authorize" parent="sylius.payum.payment_request.command_handler.token_payment_request">
<argument type="service" id="sylius.factory.payum_authorize" />
<tag name="messenger.message_handler" bus="sylius.payment_request.command_bus" handles="Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum\AuthorizePaymentRequest" />
<tag name="messenger.message_handler" bus="sylius.payment_request.command_bus" handles="Sylius\Bundle\PayumBundle\PaymentRequest\Command\AuthorizePaymentRequest" />
</service>
<service id="Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Payum\ModelPaymentRequestHandler" abstract="true">
<service id="sylius.payum.payment_request.command_handler.model_payment_request" class="Sylius\Bundle\PayumBundle\PaymentRequest\CommandHandler\ModelPaymentRequestHandler" abstract="true">
<argument type="service" id="Sylius\Bundle\CoreBundle\PaymentRequest\Provider\PaymentRequestProviderInterface" />
<argument type="service" id="sylius.payum.payment_request.resolver.doctrine_proxy_object_resolver" />
<argument type="service" id="sylius.payum.payment_request.processor.request" />
</service>
<service id="sylius.payment_request.payum.status" parent="Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Payum\ModelPaymentRequestHandler">
<service id="sylius.payum.payment_request.command_handler.model_payment_request.status" parent="sylius.payum.payment_request.command_handler.model_payment_request">
<argument type="service" id="sylius.factory.payum_get_status_action" />
<tag name="messenger.message_handler" bus="sylius.payment_request.command_bus" handles="Sylius\Bundle\CoreBundle\PaymentRequest\Command\Payum\StatusPaymentRequest" />
<tag name="messenger.message_handler" bus="sylius.payment_request.command_bus" handles="Sylius\Bundle\PayumBundle\PaymentRequest\Command\StatusPaymentRequest" />
</service>
</services>
</container>