Controller/PaymentController.php
public function doneAction(Request $request)
    {
        $token = $this->get('payum')->getHttpRequestVerifier()->verify($request);

        $gateway = $this->get('payum')->getGateway($token->getGatewayName());

        // you can invalidate the token. The url could not be requested any more.
        // $this->get('payum')->getHttpRequestVerifier()->invalidate($token);

        // Once you have token you can get the model from the storage directly.
        //$identity = $token->getDetails();
        //$payment = $this->get('payum')->getStorage($identity->getClass())->find($identity);

        // or Payum can fetch the model for you while executing a request (Preferred).
        $gateway->execute($status = new GetHumanStatus($token));
        /** @var PaymentInterface $payment */
        $payment = $status->getFirstModel();
        /** @var BaseOrderInterface $order */
        $order = $payment->getOrder();

        $em = $this->getDoctrine()->getManager();

        if ((float)$payment->getTotalAmount() !== ((float)$order->getTotalPrice()) * 100) {
            throw new \LogicException('amount of the payment is not equal to the amount of the order (' . $payment->getTotalAmount() . '!=' . $order->getTotalPrice());
        }

        $this->get('dywee_order.status_manager')->changePaymentStatus($order, $status);

        $this->get('event_dispatcher')->dispatch(DyweeOrderEvent::PAYMENT_VALIDATED, new PaymentValidatedEvent($order));

        $em->persist($order);
        $em->flush();

        return $this->redirectToRoute('checkout_confirmation');
    }
public function doneAction(Request $request)
    {
        $token = $this->get('payum')->getHttpRequestVerifier()->verify($request);

        $gateway = $this->get('payum')->getGateway($token->getGatewayName());

        // you can invalidate the token. The url could not be requested any more.
        // $this->get('payum')->getHttpRequestVerifier()->invalidate($token);

        // Once you have token you can get the model from the storage directly.
        //$identity = $token->getDetails();
        //$payment = $this->get('payum')->getStorage($identity->getClass())->find($identity);

        // or Payum can fetch the model for you while executing a request (Preferred).
        $gateway->execute($status = new GetHumanStatus($token));
        /** @var PaymentInterface $payment */
        $payment = $status->getFirstModel();
        /** @var BaseOrderInterface $order */
        $order = $payment->getOrder();

        $em = $this->getDoctrine()->getManager();

        if ((float)$payment->getTotalAmount() !== ((float)$order->getTotalPrice()) * 100) {
            throw new \LogicException('amount of the payment is not equal to the amount of the order (' . $payment->getTotalAmount() . '!=' . $order->getTotalPrice());
        }

        $this->get('dywee_order.status_manager')->changePaymentStatus($order, $status);

        $this->get('event_dispatcher')->dispatch(DyweeOrderEvent::PAYMENT_VALIDATED, new PaymentValidatedEvent($order));

        $em->persist($order);
        $em->flush();

        return $this->redirectToRoute('checkout_confirmation');
    }
@Route(path="order/payment/done", name="order_payment_done")
@param Request $request

@return Response