Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php declare(strict_types=1); |
||
23 | public function pay(SyncPaymentTransactionStruct $transaction, RequestDataBag $dataBag, SalesChannelContext $salesChannelContext): void |
||
24 | { |
||
25 | $transactionId = $transaction->getOrderTransaction()->getId(); |
||
26 | $order = $transaction->getOrder(); |
||
27 | |||
28 | $lineItems = $order->getLineItems(); |
||
29 | if ($lineItems === null) { |
||
30 | throw new SyncPaymentProcessException($transactionId, 'lineItems is null'); |
||
31 | } |
||
32 | |||
33 | $customer = $order->getOrderCustomer()?->getCustomer(); |
||
34 | if ($customer === null) { |
||
35 | throw new SyncPaymentProcessException($transactionId, 'customer is null'); |
||
36 | } |
||
37 | |||
38 | $context = $salesChannelContext->getContext(); |
||
39 | $this->transactionStateHandler->process($transactionId, $context); |
||
40 | } |
||
42 |