public function doneAction(Request $request)
    {
        $debug = $this->container->getParameter('kernel.debug');

        $token = $this->getHttpRequestVerifier()->verify($request);

        $gateway = $this->getPayum()->getGateway($token->getGatewayName());

        $gateway->execute($done = new Done($token));

        if (!$debug) {
            $this->getHttpRequestVerifier()->invalidate($token);
        }

        /** @var \Ekyna\Component\Sale\Payment\PaymentInterface $payment */
        $payment = $done->getFirstModel();

        $event = new PaymentEvent($payment);
        $this->getDispatcher()->dispatch(PaymentEvents::DONE, $event);
        if (null !== $response = $event->getResponse()) {
            return $response;
        }

        if ($debug) {
            return $this->render('EkynaPaymentBundle:Payment:done.html.twig', [
                'payment' => $payment,
            ]);
        }

        return $this->redirect('/');
    }