if ($page->
isPaymentChangeable() === false
) { $refundsEnabled =
$this->systemConfigService->
get('core.cart.enableOrderRefunds'
);
if ($refundsEnabled) { $this->
addFlash(self::DANGER,
$this->
trans('account.editOrderPaymentNotChangeableWithRefunds'
));
} else { $this->
addFlash(self::DANGER,
$this->
trans('account.editOrderPaymentNotChangeable'
));
} } $page->
setErrorCode($request->
get('error-code'
));
return $this->
renderStorefront('@Storefront/storefront/page/account/order/index.html.twig',
['page' =>
$page]);
} #[Route(path: '/account/order/payment/{orderId}', name: 'frontend.account.edit-order.change-payment-method', methods: ['POST'])]
public function orderChangePayment(string
$orderId, Request
$request, SalesChannelContext
$context): Response
{ $this->contextSwitchRoute->
switchContext( new RequestDataBag( [ SalesChannelContextService::PAYMENT_METHOD_ID =>
$request->
get('paymentMethodId'
),
]