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

SyncTestFailedPaymentHandler   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A pay() 0 3 1
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