src/Payum/Payex/Action/PaymentDetailsCaptureAction.php
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $details = ArrayObject::ensureArrayObject($request->getModel());

        if (false == $details['returnUrl'] && $request->getToken()) {
            $details['returnUrl'] = $request->getToken()->getTargetUrl();
        }

        if (false == $details['cancelUrl'] && $request->getToken()) {
            $details['cancelUrl'] = $request->getToken()->getTargetUrl();
        }

        if (false == $details['clientIPAddress']) {
            $this->gateway->execute($httpRequest = new GetHttpRequest());

            $details['clientIPAddress'] = $httpRequest->clientIp;
        }

        if (false == $details['orderRef']) {
            $this->gateway->execute(new InitializeOrder($details));
        }

        if ($details['orderRef']) {
            $this->gateway->execute(new CompleteOrder($details));

            if ($details['recurring']) {
                $this->gateway->execute(new StartRecurringPayment($details));
            }
        }
    }
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

        $details = ArrayObject::ensureArrayObject($request->getModel());

        if (false == $details['returnUrl'] && $request->getToken()) {
            $details['returnUrl'] = $request->getToken()->getTargetUrl();
        }

        if (false == $details['cancelUrl'] && $request->getToken()) {
            $details['cancelUrl'] = $request->getToken()->getTargetUrl();
        }

        if (false == $details['clientIPAddress']) {
            $this->gateway->execute($httpRequest = new GetHttpRequest());

            $details['clientIPAddress'] = $httpRequest->clientIp;
        }

        if (false == $details['orderRef']) {
            $this->gateway->execute(new InitializeOrder($details));
        }

        if ($details['orderRef']) {
            $this->gateway->execute(new CompleteOrder($details));

            if ($details['recurring']) {
                $this->gateway->execute(new StartRecurringPayment($details));
            }
        }
    }
{@inheritDoc}

@param Capture $request