throw $e;
} } private function getTransaction(OrderEntity
$order, SalesChannelContext
$salesChannelContext): ?OrderTransactionEntity
{ $transactions =
$order->
getTransactions();
if ($transactions === null
) { throw PaymentException::
invalidOrder($order->
getId());
} $transactions =
$transactions->
filterByStateId( $this->initialStateIdLoader->
get(OrderTransactionStates::STATE_MACHINE
) );
return $transactions->
last();
} private function getPaymentHandlerFromTransaction(OrderTransactionEntity
$transaction): PaymentHandlerInterface
{ $paymentMethod =
$transaction->
getPaymentMethod();
if ($paymentMethod === null
) { throw PaymentException::
unknownPaymentMethod($transaction->
getPaymentMethodId());
}