$message =
$this->
trans('error.' .
$e->
getErrorCode());
$this->
addFlash('danger',
$message);
return $this->
forwardToRoute('frontend.checkout.confirm.page'
);
} try { $finishUrl =
$this->
generateUrl('frontend.checkout.finish.page',
['orderId' =>
$orderId]);
$errorUrl =
$this->
generateUrl('frontend.account.edit-order.page',
['orderId' =>
$orderId]);
$response = Profiler::
trace('handle-payment',
fn (): ?RedirectResponse =>
$this->paymentService->
handlePaymentByOrder($orderId,
$data,
$context,
$finishUrl,
$errorUrl));
return $response ??
new RedirectResponse($finishUrl);
} catch (PaymentProcessException|InvalidOrderException|PaymentException|UnknownPaymentMethodException
) { return $this->
forwardToRoute('frontend.checkout.finish.page',
['orderId' =>
$orderId, 'changedPayment' => false, 'paymentFailed' => true
]);
} } #[Route(path: '/widgets/checkout/info', name: 'frontend.checkout.info', defaults: ['XmlHttpRequest' => true], methods: ['GET'])]
public function info(Request
$request, SalesChannelContext
$context): Response
{ $cart =
$this->cartService->
getCart($context->
getToken(),
$context);