| Conditions | 4 | 
| Paths | 2 | 
| Total Lines | 29 | 
| Code Lines | 17 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Changes | 0 | ||
| 1 | <?php  | 
            ||
| 27 | public function thankYouAction(Request $request)  | 
            ||
| 28 |     { | 
            ||
| 29 | $configuration = $this->requestConfigurationFactory->create($this->metadata, $request);  | 
            ||
| 30 | |||
| 31 |         $orderId = $request->getSession()->get('sylius_order_id', null); | 
            ||
| 32 | |||
| 33 |         if (null === $orderId) { | 
            ||
| 34 |             $options = $configuration->getParameters()->get('after_failure'); | 
            ||
| 35 | |||
| 36 | return $this->redirectHandler->redirectToRoute(  | 
            ||
| 37 | $configuration,  | 
            ||
| 38 | isset($options['route']) ? $options['route'] : 'sylius_shop_homepage',  | 
            ||
| 39 | isset($options['parameters']) ? $options['parameters'] : []  | 
            ||
| 40 | );  | 
            ||
| 41 | }  | 
            ||
| 42 | |||
| 43 |         $request->getSession()->remove('sylius_order_id'); | 
            ||
| 44 | $order = $this->repository->find($orderId);  | 
            ||
| 45 | Assert::notNull($order);  | 
            ||
| 46 | |||
| 47 | $view = View::create()  | 
            ||
| 48 | ->setData([  | 
            ||
| 49 | 'order' => $order  | 
            ||
| 50 | ])  | 
            ||
| 51 |             ->setTemplate($configuration->getParameters()->get('template')) | 
            ||
| 52 | ;  | 
            ||
| 53 | |||
| 54 | return $this->viewHandler->handle($configuration, $view);  | 
            ||
| 55 | }  | 
            ||
| 56 | }  | 
            ||
| 57 |