Passed
Push — trunk ( 49986f...44ff76 )
by Christian
22:08 queued 08:23
created

SyncTestFailedPaymentHandler::pay()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Test\Integration\PaymentHandler;
4
5
use Shopware\Core\Checkout\Payment\Cart\PaymentHandler\SynchronousPaymentHandlerInterface;
6
use Shopware\Core\Checkout\Payment\Cart\SyncPaymentTransactionStruct;
7
use Shopware\Core\Checkout\Payment\PaymentException;
8
use Shopware\Core\Framework\Log\Package;
9
use Shopware\Core\Framework\Validation\DataBag\RequestDataBag;
10
use Shopware\Core\System\SalesChannel\SalesChannelContext;
11
12
/**
13
 * @internal
14
 */
15
#[Package('checkout')]
16
class SyncTestFailedPaymentHandler implements SynchronousPaymentHandlerInterface
17
{
18
    public function pay(SyncPaymentTransactionStruct $transaction, RequestDataBag $dataBag, SalesChannelContext $salesChannelContext): void
19
    {
20
        throw PaymentException::syncProcessInterrupted($transaction->getOrderTransaction()->getId(), 'This is a TestPaymentHandler which will always fail');
21
    }
22
}
23