protected function doJob(AbstractJob $job)
    {
        $gatewayClass = $this->analiseGateway($job);

        if ($job->isSync()) {
            $worker = AbstractWorker::factory($gatewayClass);

            return $worker($job);
        }

        if (!$job->hasAttempt()) {
            throw new ResultException(ResultException::FAILURE_MAX_ATTEMPTS);
        }

        // redirect result for new gateway class
        $job->addDebug(['set_gateway' => $gatewayClass]);
        $job->setWorkerClass($gatewayClass)->save();

        throw new ResultException(ResultException::REDIRECT_GATEWAY_CLASS);
    }