$criteria =
new Criteria([$orderTransactionId]);
$criteria->
addAssociation('paymentMethod'
);
$criteria->
addAssociation('order.orderCustomer'
);
$criteria->
addAssociation('order.transactions.stateMachineState'
);
$orderTransaction =
$this->transactionRepository
->
search($criteria,
$event->
getContext()) ->
first();
if ($orderTransaction === null
) { throw OrderException::
orderTransactionNotFound($orderTransactionId);
} if ($orderTransaction->
getPaymentMethod() === null
) { throw OrderException::
orderTransactionNotFound($orderTransactionId);
} if ($orderTransaction->
getOrder() === null
) { throw OrderException::
orderTransactionNotFound($orderTransactionId);
} $context =
$this->
getContext($orderTransaction->
getOrderId(),
$event->
getContext());