Action/CaptureAction.php
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

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

        if (false == $model['customer_ip_address']) {
            $this->gateway->execute($httpRequest = new GetHttpRequest());
            $model['customer_ip_address'] = $httpRequest->clientIp;
        }

        if (false == $model['normal_return_url'] && $request->getToken()) {
            $model['normal_return_url'] = $request->getToken()->getTargetUrl();
        }
        if (false == $model['cancel_return_url'] && $request->getToken()) {
            $model['cancel_return_url'] = $request->getToken()->getTargetUrl();
        }
        if (empty($model['automatic_response_url']) && $request->getToken() && $this->tokenFactory) {
            $notifyToken = $this->tokenFactory->createNotifyToken(
                $request->getToken()->getGatewayName(),
                $request->getToken()->getDetails()
            );
            $model['automatic_response_url'] = $notifyToken->getTargetUrl();
        }

        if (false == $model['transaction_id']) {
            $this->gateway->execute(new CallRequest($model));
        }

        $this->gateway->execute(new Sync($model));
    }
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

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

        if (false == $model['customer_ip_address']) {
            $this->gateway->execute($httpRequest = new GetHttpRequest());
            $model['customer_ip_address'] = $httpRequest->clientIp;
        }

        if (false == $model['normal_return_url'] && $request->getToken()) {
            $model['normal_return_url'] = $request->getToken()->getTargetUrl();
        }
        if (false == $model['cancel_return_url'] && $request->getToken()) {
            $model['cancel_return_url'] = $request->getToken()->getTargetUrl();
        }
        if (empty($model['automatic_response_url']) && $request->getToken() && $this->tokenFactory) {
            $notifyToken = $this->tokenFactory->createNotifyToken(
                $request->getToken()->getGatewayName(),
                $request->getToken()->getDetails()
            );
            $model['automatic_response_url'] = $notifyToken->getTargetUrl();
        }

        if (false == $model['transaction_id']) {
            $this->gateway->execute(new CallRequest($model));
        }

        $this->gateway->execute(new Sync($model));
    }
public function execute ( $ request ) { RequestNotSupportedException :: assertSupports ( $ this , $ request ) ; $ model = ArrayObject :: ensureArrayObject ( $ request -> getModel ( ) ) ; if ( false == $ model [ 'customer_ip_address' ] ) { $ this -> gateway -> execute ( $ httpRequest = new GetHttpRequest ( ) ) ; $ model [ 'customer_ip_address' ] = $ httpRequest -> clientIp ; } if ( false == $ model [ 'normal_return_url' ] && $ request -> getToken ( ) ) { $ model [ 'normal_return_url' ] = $ request -> getToken ( ) -> getTargetUrl ( ) ; } if ( false == $ model [ 'cancel_return_url' ] && $ request -> getToken ( ) ) { $ model [ 'cancel_return_url' ] = $ request -> getToken ( ) -> getTargetUrl ( ) ; } if ( empty ( $ model [ 'automatic_response_url' ] ) && $ request -> getToken ( ) && $ this -> tokenFactory ) { $ notifyToken = $ this -> tokenFactory -> createNotifyToken ( $ request -> getToken ( ) -> getGatewayName ( ) , $ request -> getToken ( ) -> getDetails ( ) ) ; $ model [ 'automatic_response_url' ] = $ notifyToken -> getTargetUrl ( ) ; } if ( false == $ model [ 'transaction_id' ] ) { $ this -> gateway -> execute ( new CallRequest ( $ model ) ) ; } $ this -> gateway -> execute ( new Sync ( $ model ) ) ; }
{@inheritdoc}
{