Controller/CartController.php
public function confirmationAction(Request $request)
    {
        /** @var \Ekyna\Component\Sale\Order\OrderInterface $order */
        $order = $this->get('ekyna_order.order.repository')->findOneByKey(
            $request->attributes->get('orderKey')
        );

        if (null === $order) {
            throw new NotFoundHttpException('Order not found.');
        }

        if (null !== $user = $order->getUser()) {
            if ($user !== $this->getUser()) {
                throw new AccessDeniedHttpException('You are not allowed to view this resource.');
            }
        }

        if (null === $payment = $order->findPaymentById($request->attributes->get('paymentId'))) {
            throw new NotFoundHttpException('Payment not found.');
        }

        /** @var \Ekyna\Bundle\PaymentBundle\Model\MethodInterface $method */
        $method = $payment->getMethod();
        $message = $method->getMessageByState($payment->getState());
        if (null === $message || 0 == strlen($message->getFlash())) {
            $message = null;
        }

        return $this->render('EkynaCartBundle:Cart:confirmation.html.twig', [
            'order'   => $order,
            'payment' => $payment,
            'message' => $message,
        ]);
    }
public function confirmationAction(Request $request)
    {
        /** @var \Ekyna\Component\Sale\Order\OrderInterface $order */
        $order = $this->get('ekyna_order.order.repository')->findOneByKey(
            $request->attributes->get('orderKey')
        );

        if (null === $order) {
            throw new NotFoundHttpException('Order not found.');
        }

        if (null !== $user = $order->getUser()) {
            if ($user !== $this->getUser()) {
                throw new AccessDeniedHttpException('You are not allowed to view this resource.');
            }
        }

        if (null === $payment = $order->findPaymentById($request->attributes->get('paymentId'))) {
            throw new NotFoundHttpException('Payment not found.');
        }

        /** @var \Ekyna\Bundle\PaymentBundle\Model\MethodInterface $method */
        $method = $payment->getMethod();
        $message = $method->getMessageByState($payment->getState());
        if (null === $message || 0 == strlen($message->getFlash())) {
            $message = null;
        }

        return $this->render('EkynaCartBundle:Cart:confirmation.html.twig', [
            'order'   => $order,
            'payment' => $payment,
            'message' => $message,
        ]);
    }
public function confirmationAction ( Request $ request ) { /** @var \Ekyna\Component\Sale\Order\OrderInterface $order */ $ order = $ this -> get ( 'ekyna_order.order.repository' ) -> findOneByKey ( $ request -> attributes -> get ( 'orderKey' ) ) ; if ( null === $ order ) { throw new NotFoundHttpException ( 'Order not found.' ) ; } if ( null !== $ user = $ order -> getUser ( ) ) { if ( $ user !== $ this -> getUser ( ) ) { throw new AccessDeniedHttpException ( 'You are not allowed to view this resource.' ) ; } } if ( null === $ payment = $ order -> findPaymentById ( $ request -> attributes -> get ( 'paymentId' ) ) ) { throw new NotFoundHttpException ( 'Payment not found.' ) ; } /** @var \Ekyna\Bundle\PaymentBundle\Model\MethodInterface $method */ $ method = $ payment -> getMethod ( ) ; $ message = $ method -> getMessageByState ( $ payment -> getState ( ) ) ; if ( null === $ message || 0 == strlen ( $ message -> getFlash ( ) ) ) { $ message = null ; } return $ this -> render ( 'EkynaCartBundle:Cart:confirmation.html.twig' , [ 'order' => $ order , 'payment' => $ payment , 'message' => $ message , ] ) ; }
Confirmation action.

@param Request $request
@return \Symfony\Component\HttpFoundation\RedirectResponse|Response
Confirmation action .