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

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

        $httpRequest = new GetHttpRequest();
        $this->gateway->execute($httpRequest);

        //we are back from be2bill site so we have to just update model.
        if (isset($httpRequest->query['EXECCODE'])) {
            $model->replace($httpRequest->query);
        } else {
            $extradata = $model['EXTRADATA'] ? json_decode($model['EXTRADATA'], true) : [];

            if (false == isset($extradata['capture_token']) && $request->getToken()) {
                $extradata['capture_token'] = $request->getToken()->getHash();
            }

            if (false == isset($extradata['notify_token']) && $request->getToken() && $this->tokenFactory) {
                $notifyToken = $this->tokenFactory->createNotifyToken(
                    $request->getToken()->getGatewayName(),
                    $request->getToken()->getDetails()
                );

                $extradata['notify_token'] = $notifyToken->getHash();
            }

            $model['EXTRADATA'] = json_encode($extradata);

            throw new HttpPostRedirect(
                $this->api->getOffsiteUrl(),
                $this->api->prepareOffsitePayment($model->toUnsafeArray())
            );
        }
    }
public function execute($request)
    {
        RequestNotSupportedException::assertSupports($this, $request);

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

        $httpRequest = new GetHttpRequest();
        $this->gateway->execute($httpRequest);

        //we are back from be2bill site so we have to just update model.
        if (isset($httpRequest->query['EXECCODE'])) {
            $model->replace($httpRequest->query);
        } else {
            $extradata = $model['EXTRADATA'] ? json_decode($model['EXTRADATA'], true) : [];

            if (false == isset($extradata['capture_token']) && $request->getToken()) {
                $extradata['capture_token'] = $request->getToken()->getHash();
            }

            if (false == isset($extradata['notify_token']) && $request->getToken() && $this->tokenFactory) {
                $notifyToken = $this->tokenFactory->createNotifyToken(
                    $request->getToken()->getGatewayName(),
                    $request->getToken()->getDetails()
                );

                $extradata['notify_token'] = $notifyToken->getHash();
            }

            $model['EXTRADATA'] = json_encode($extradata);

            throw new HttpPostRedirect(
                $this->api->getOffsiteUrl(),
                $this->api->prepareOffsitePayment($model->toUnsafeArray())
            );
        }
    }
{@inheritDoc}

@param Capture $request