$url .
(parse_url($url, \PHP_URL_QUERY
) ? '&' : '?'
) . 'error-code=' .
$exception->
getErrorCode() );
} return new RedirectResponse($url);
} private function assembleSalesChannelContext(string
$paymentToken): SalesChannelContext
{ $context = Context::
createDefaultContext();
$transactionId =
$this->tokenFactoryInterfaceV2->
parseToken($paymentToken)->
getTransactionId();
if ($transactionId === null
) { throw PaymentException::
invalidToken($paymentToken);
} $criteria =
new Criteria();
$criteria->
addFilter(new EqualsFilter('transactions.id',
$transactionId));
$criteria->
addAssociation('transactions'
);
$criteria->
addAssociation('orderCustomer'
);
/** @var OrderEntity|null $order */
$order =
$this->orderRepository->
search($criteria,
$context)->
first();