catch (UnknownPaymentMethodException|CartException
$e) { if ($e->
getErrorCode() === CartException::CART_PAYMENT_INVALID_ORDER_STORED_CODE &&
$e->
getParameter('orderId'
)) { return $this->
forwardToRoute('frontend.checkout.finish.page',
['orderId' =>
$e->
getParameter('orderId'
), 'changedPayment' => false, 'paymentFailed' => true
]);
} $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'])]