protected function checkRequest()
    {
        if ('prod' === $this->getKernel()->getEnvironment()) {
            throw new \RuntimeException('Debug Payment is not authorized in production environment.');
        }

        $request = $this->getCurrentRequest();
        $reference = $request->get('reference');

        $order = $this->getOrderManager()->findOneBy(['reference' => $reference]);

        if (!$order) {
            throw new NotFoundHttpException(sprintf('Order with reference "%s" not found.', $reference));
        }

        if ($request->get('check') !== $this->getDebugPayment()->generateUrlCheck($order)) {
            throw new InvalidTransactionException($reference);
        }

        return $order;
    }
protected function checkRequest()
    {
        if ('prod' === $this->getKernel()->getEnvironment()) {
            throw new \RuntimeException('Debug Payment is not authorized in production environment.');
        }

        $request = $this->getCurrentRequest();
        $reference = $request->get('reference');

        $order = $this->getOrderManager()->findOneBy(['reference' => $reference]);

        if (!$order) {
            throw new NotFoundHttpException(sprintf('Order with reference "%s" not found.', $reference));
        }

        if ($request->get('check') !== $this->getDebugPayment()->generateUrlCheck($order)) {
            throw new InvalidTransactionException($reference);
        }

        return $order;
    }
protected function checkRequest ( ) { if ( 'prod' === $ this -> getKernel ( ) -> getEnvironment ( ) ) { throw new \ RuntimeException ( 'Debug Payment is not authorized in production environment.' ) ; } $ request = $ this -> getCurrentRequest ( ) ; $ reference = $ request -> get ( 'reference' ) ; $ order = $ this -> getOrderManager ( ) -> findOneBy ( [ 'reference' => $ reference ] ) ; if ( ! $ order ) { throw new NotFoundHttpException ( sprintf ( 'Order with reference "%s" not found.' , $ reference ) ) ; } if ( $ request -> get ( 'check' ) !== $ this -> getDebugPayment ( ) -> generateUrlCheck ( $ order ) ) { throw new InvalidTransactionException ( $ reference ) ; } return $ order ; }
Check the Request and return the current Order.

@throws InvalidTransactionException
@throws NotFoundHttpException
@throws \RuntimeException

@return OrderInterface
Check the Request and return the current Order .