<?php declare(strict_types=1);
namespace Swag\BasicExample\Service;
use Shopware\Core\Checkout\Order\Aggregate\OrderTransaction\OrderTransactionStateHandler;
use Shopware\Core\Checkout\Payment\Cart\PaymentHandler\DebitPayment;
use Shopware\Core\Checkout\Payment\Cart\SyncPaymentTransactionStruct;
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
use Shopware\Core\System\SalesChannel\SalesChannelContext;
class ExampleDebitPayment extends DebitPayment
private DebitPayment $decorated;
public function __construct(OrderTransactionStateHandler $transactionStateHandler, DebitPayment $decorated)
parent::__construct($transactionStateHandler);
$this->decorated = $decorated;
public function getDecorated(): DebitPayment
public function pay(SyncPaymentTransactionStruct $transaction, RequestDataBag $dataBag, SalesChannelContext $salesChannelContext): void
// do some custom stuff here
$this->transactionStateHandler->process($transaction->getOrderTransaction()->getId(), $salesChannelContext->getContext());