src/Payum/Core/Gateway.php
public function execute($request, $catchReply = false)
    {
        $context = new Context($this, $request, $this->stack);

        array_push($this->stack, $context);

        try {
            $this->extensions->onPreExecute($context);

            if (false == $context->getAction()) {
                if (false == $action = $this->findActionSupported($context->getRequest())) {
                    throw RequestNotSupportedException::create($context->getRequest());
                }

                $context->setAction($action);
            }

            $this->extensions->onExecute($context);

            $context->getAction()->execute($request);

            $this->extensions->onPostExecute($context);

            array_pop($this->stack);
        } catch (ReplyInterface $reply) {
            $context->setReply($reply);

            $this->extensions->onPostExecute($context);

            array_pop($this->stack);

            if ($catchReply && $context->getReply()) {
                return $context->getReply();
            }

            if ($context->getReply()) {
                throw $context->getReply();
            }
        } catch (\Exception $e) {
            $context->setException($e);

            $this->onPostExecuteWithException($context);
        }

        return;
    }
public function execute($request, $catchReply = false)
    {
        $context = new Context($this, $request, $this->stack);

        array_push($this->stack, $context);

        try {
            $this->extensions->onPreExecute($context);

            if (false == $context->getAction()) {
                if (false == $action = $this->findActionSupported($context->getRequest())) {
                    throw RequestNotSupportedException::create($context->getRequest());
                }

                $context->setAction($action);
            }

            $this->extensions->onExecute($context);

            $context->getAction()->execute($request);

            $this->extensions->onPostExecute($context);

            array_pop($this->stack);
        } catch (ReplyInterface $reply) {
            $context->setReply($reply);

            $this->extensions->onPostExecute($context);

            array_pop($this->stack);

            if ($catchReply && $context->getReply()) {
                return $context->getReply();
            }

            if ($context->getReply()) {
                throw $context->getReply();
            }
        } catch (\Exception $e) {
            $context->setException($e);

            $this->onPostExecuteWithException($context);
        }

        return;
    }
{@inheritDoc}