[PaymentRequest] Move offline command and command handlers to PaymentBundle

This commit is contained in:
Grzegorz Sadowski 2024-09-27 11:50:22 +02:00
parent 55f01c4ccd
commit 49a22c7826
No known key found for this signature in database
GPG key ID: EF87FF4E6E3BD364
6 changed files with 16 additions and 19 deletions

View file

@ -11,7 +11,7 @@
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\Command\Offline;
namespace Sylius\Bundle\PaymentBundle\Command\Offline;
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,10 +11,10 @@
declare(strict_types=1);
namespace Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Offline;
namespace Sylius\Bundle\PaymentBundle\CommandHandler\Offline;
use Sylius\Bundle\CoreBundle\PaymentRequest\Command\Offline\CapturePaymentRequest;
use Sylius\Bundle\CoreBundle\PaymentRequest\Provider\PaymentRequestProviderInterface;
use Sylius\Bundle\PaymentBundle\Command\Offline\CapturePaymentRequest;
use Sylius\Component\Payment\Model\PaymentRequestInterface;
use Symfony\Component\Messenger\Attribute\AsMessageHandler;

View file

@ -13,7 +13,7 @@ declare(strict_types=1);
namespace Sylius\Bundle\PaymentBundle\CommandProvider\Offline;
use Sylius\Bundle\CoreBundle\PaymentRequest\Command\Offline\CapturePaymentRequest;
use Sylius\Bundle\PaymentBundle\Command\Offline\CapturePaymentRequest;
use Sylius\Bundle\PaymentBundle\CommandProvider\PaymentRequestCommandProviderInterface;
use Sylius\Component\Payment\Model\PaymentRequestInterface;

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.payment_request.offline.capture" class="Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Offline\CapturePaymentRequestHandler">
<service id="sylius.payment_request.offline.capture" class="Sylius\Bundle\PaymentBundle\CommandHandler\Offline\CapturePaymentRequestHandler">
<argument type="service" id="Sylius\Bundle\CoreBundle\PaymentRequest\Provider\PaymentRequestProviderInterface" />
<tag name="messenger.message_handler" bus="sylius.payment_request.command_bus" />
</service>

View file

@ -31,7 +31,7 @@
<tag name="sylius.payment_request.command_provider" gateway-factory="offline" />
</service>
<service id="sylius.payment_request.command_provider.offline.capture" class="Sylius\Bundle\CoreBundle\PaymentRequest\CommandProvider\Offline\CapturePaymentRequestCommandProvider">
<service id="sylius.payment_request.command_provider.offline.capture" class="Sylius\Bundle\PaymentBundle\CommandProvider\Offline\CapturePaymentRequestCommandProvider">
<tag name="sylius.payment_request.command_provider.offline" action="capture" />
</service>
</services>

View file

@ -11,20 +11,17 @@
declare(strict_types=1);
namespace spec\Sylius\Bundle\CoreBundle\PaymentRequest\CommandHandler\Offline;
namespace spec\Sylius\Bundle\PaymentBundle\CommandHandler\Offline;
use PhpSpec\ObjectBehavior;
use Sylius\Bundle\CoreBundle\PaymentRequest\Command\Offline\CapturePaymentRequest;
use Sylius\Bundle\CoreBundle\PaymentRequest\Processor\Offline\CaptureProcessorInterface;
use Sylius\Bundle\CoreBundle\PaymentRequest\Provider\PaymentRequestProviderInterface;
use Sylius\Component\Payment\Model\PaymentRequest;
use Sylius\Bundle\PaymentBundle\Command\Offline\CapturePaymentRequest;
use Sylius\Component\Payment\Model\PaymentRequestInterface;
final class CapturePaymentRequestHandlerSpec extends ObjectBehavior
{
function let(
PaymentRequestProviderInterface $paymentRequestProvider
): void {
function let(PaymentRequestProviderInterface $paymentRequestProvider): void
{
$this->beConstructedWith($paymentRequestProvider);
}