/**
  * {@inheritdoc}
  *
  * @param ResolveNextRoute $request
  */
 public function execute($request)
 {
     /** @var PaymentInterface $payment */
     $payment = $request->getFirstModel();
     if ($payment->getState() === PaymentInterface::STATE_COMPLETED) {
         $request->setRouteName('sylius_shop_order_thank_you');
         return;
     }
     $request->setRouteName('sylius_shop_order_show_details');
     $request->setRouteParameters(['tokenValue' => $payment->getOrder()->getTokenValue()]);
 }
 function it_resolves_next_route_for_processing_payment(ResolveNextRoute $resolveNextRouteRequest, PaymentInterface $payment, OrderInterface $order)
 {
     $resolveNextRouteRequest->getFirstModel()->willReturn($payment);
     $payment->getState()->willReturn(PaymentInterface::STATE_PROCESSING);
     $payment->getOrder()->willReturn($order);
     $order->getTokenValue()->willReturn('qwerty');
     $resolveNextRouteRequest->setRouteName('sylius_shop_order_show_details')->shouldBeCalled();
     $resolveNextRouteRequest->setRouteParameters(['tokenValue' => 'qwerty'])->shouldBeCalled();
     $this->execute($resolveNextRouteRequest);
 }
 function it_resolves_next_route(ResolveNextRoute $resolveNextRouteRequest)
 {
     $resolveNextRouteRequest->setRouteName('sylius_shop_order_thank_you')->shouldBeCalled();
     $this->execute($resolveNextRouteRequest);
 }
 /**
  * {@inheritdoc}
  *
  * @param ResolveNextRoute $request
  */
 public function execute($request)
 {
     $request->setRouteName('sylius_shop_order_thank_you');
 }