Handles the controller method.

@return \Magento\Framework\Controller\Result\Redirect
978566
public function execute() {

        // Get the payment token from response
        $paymentToken = $this->extractPaymentToken();

        // Process the gateway response
        $this->response = $this->verifyPaymentService->verifyPayment($paymentToken);

        // Debug info
        $this->watchdog->bark($this->response);

        // If this is a 3D Secure fail
        if ($this->is3DSFailure()) {

            // Try to rebuild the customer cart
            $this->rebuildFailedOrderCart();
        }

        // Add the response message
        $this->messageManager->addErrorMessage( __("The transaction couldn't be processed or has been cancelled."));                

        // Redirect to cart
        return $this->redirect->setPath('checkout/cart', ['_secure' => true]);
    }
1315378
public function handle()
    {
        if (empty($this->routes)) {
            return $this->error("Your application doesn't have any routes.");
        }

        if (empty($routes = $this->getRoutes())) {
            return $this->error("Your application doesn't have any routes matching the given criteria.");
        }

        $this->displayRoutes($routes);
    }
354798
public function handle()
    {
        // Access-Control-Allow-Origin header should always be set
        $this->header_manager->addHeader("Access-Control-Allow-Origin", join(', ', $this->cors_allowed_origin));

        $http_methods_allowed = HttpMethods::getMethodsWhereRequestBodyIsAllowed();
        $http_methods_allowed[] = HttpMethods::GET;
        if (in_array($this->getMethod(), $http_methods_allowed)) {
            try {
                $this->data = $this->getData();
            } catch (RestException $e) {
                $this->handleError($e->getCode(), $e->getMessage());
            }
        }

        list($obj, $method, $params, $this->params, $keys) = $this->findUrl();

        if ($obj) {
            if (is_string($obj)) {
                if (class_exists($obj)) {
                    $obj = new $obj();
                } else {
                    throw new Exception("Class $obj does not exist");
                }
            }

            $obj->server = $this;

            try {
                if (method_exists($obj, 'init')) {
                    $obj->init();
                }

                if (empty($keys['noAuth'])) {
                    if (method_exists($this, 'doServerWideAuthorization')) {
                        if (!$this->doServerWideAuthorization()) {
                            $this->unauthorized(false);
                        }
                    } elseif (method_exists($obj, 'authorize')) {
                        // Standard behaviour
                        if (!$obj->authorize()) {
                            $this->unauthorized(false);
                        }
                    }
                }

                $accept_language_header = isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])
                    ? $_SERVER['HTTP_ACCEPT_LANGUAGE']
                    : '';
                $language = new Language(
                    $this->supported_languages,
                    $this->default_language,
                    $accept_language_header
                );
                $params = $this->injectLanguageIntoMethodParameters($language, $obj, $method, $params);

                $result = call_user_func_array(array($obj, $method), $params);

                $this->automaticContentLanguageHeaderDispatch($language);

            } catch (RestException $e) {
                $this->handleError($e->getCode(), $e->getMessage());
            }

            if (!empty($result)) {
                $this->sendData($result);
            }
        } elseif (!isset($obj) && $this->getMethod() == HttpMethods::OPTIONS) {
            $this->handleCorsPreflightRequest();
        } else {
            $this->handleError(HttpStatusCodes::NOT_FOUND);
        }
    }
1230892
public function handle()
    {
        $this->laravel['events']->dispatch(
            'cache:clearing', [$this->argument('store'), $this->tags()]
        );

        $successful = $this->cache()->flush();

        $this->flushFacades();

        if (! $successful) {
            return $this->error('Failed to clear cache. Make sure you have the appropriate permissions.');
        }

        $this->laravel['events']->dispatch(
            'cache:cleared', [$this->argument('store'), $this->tags()]
        );

        $this->info('Application cache cleared!');
    }
766733
public function handle()
    {
        // New permissions
        $permissions = new Collection();

        // Remove not existing permissions
        Permission::whereNotIn('resource', $this->routes->keys()->toArray())->delete();

        foreach ($this->routes as $route) {
            // Do we have the current permission in the database. If so skip it...
            $existing_permission = Permission::where('resource', '=', $route['resource'])->first();
            if ($existing_permission) {
                continue;
            }

            // Skip some methods
            $data = $this->getPermissionData($route);
            if ($data['method'] == 'missingMethod') {
                continue;
            }

            // Add new permission
            $permissions->push(Permission::create($data));
        }

        $this->assignPermissions($permissions);
    }
1100302
public function handle()
    {
        Redis::throttle($this->getUniqueKey())->allow($this->max_concurrent_jobs)->every($this->throttle_seconds)->then(function () {

            if (! $this->preflighted()) return;

            $this->job();
        }, function () {

            return $this->delete();
        });
    }
1295084
private function handle(){
        $params = [
            "start"     => null,
            "finish"    => null,
            "response"  => null,
            "error"     => null,
        ];

        try{
            $params["start"]    = microtime(true);
            $params["response"] = $this->handler->handle($this->request);
        }catch(\Throwable $e){
            $params["error"]    = $e;
            $this->error        = $e;
        }finally{
            $params["finish"]   = microtime(true);
        }

        $this->event(new Event("response.handle.after", $params));

        return $params["response"];
    }
324573
public function handle()
	{
		// Get Var Elements
		$accessToken = $this->getAccessToken();

		$state = $this->getVar("state");
		
		// Initiate OAuth Client with Specific server configuration
		$to = new $this->_className();

		// Try to Handle the Authentication Process
		if ($accessToken == "")
		{
			$code = $this->_context->get("code");
			
			// If not received the "Code" Parameter, initiate the autorization request
			if ($code == "")
			{
				$state = md5(uniqid(rand(), TRUE)); //CSRF protection
				$this->setVar("state", $state);
				
				$params = array(
					"client_id" => $this->_client_id,
					"redirect_uri" => $this->_redirect_uri,
					"state" => $state,
					"scope" => $this->_scope
				);

				if (count($this->_extraArgs) > 0)
				{
					$params = array_merge($params, $this->_extraArgs);
				}
				
				$req = new WebRequest($to->authorizationURL());
				$req->redirect($params, $this->_window_top);
			}
			
			// Request the Access Token
			if ($this->_context->get("state") == $this->getVar("state"))
			{
				$params = array(
					"client_id" => $this->_client_id,
					"redirect_uri" => $this->_redirect_uri,
					"client_secret" => $this->_client_secret,
					"code" => $code,
					"grant_type" => "authorization_code"
				);
				
				$req = new WebRequest($to->accessTokenURL());
				$result = $req->post($params);

				$accessToken = $to->decodeAccessToken($result);
				
				$this->setVar("access_token", $accessToken);
				$to->setAccessToken($accessToken);
				
				$this->saveAccessToken();
				
				if ($this->_app_uri != "")
				{
					$req = new WebRequest($this->_app_uri);
					$response = $req->redirect();
				}
			}
		}
		else 
		{
			$to->setAccessToken($this->getVar('access_token'));
		}
		
		return $to;
		
	}
520568
public function dispatch()
    {
        $handler = [$this->controller, 'initialize'];
        if (method_exists($this->controller, 'initialize') && is_callable($handler)) {
            call_user_func($handler);
        }

        $this->isCallableOrException();

        return call_user_func_array([$this->controller, $this->action], $this->params);
    }
1329618
public function handle()
    {
        $arguments    = func_get_args();
        $handleMethod = array_shift($arguments);

        return call_user_func_array([$this->handler->initialize($this), $handleMethod], $arguments);
    }
937933
public function handle()
    {
        $input = $this->getCommandInput();
        $file = $this->getFilename($input->file);

        if (!$this->isFileExists($file)) {
            $this->error('The resource-file does not exists!');

            return false;
        }

        $resource = $this->getResources($file, $input->translationFor);

        $resource->setDefaultApiDocLabels($input->modelName, self::makeLocaleGroup($input->modelName), $input->translationFor);

        dd($resource->toArray());

        $content = Helpers::prettifyJson($resource->toArray());

        $this->putContentInFile($file, $content);
    }
1253926
public function handleRequest()
    {
        try {
            $this->response = parent::handleRequest();
        } catch (HttpException $ex) {
            $this->config->set('page_title', 'Error');

            $view = new View('exception');
            $view->exception = $ex;

            $this->response->setResponseCode($ex->getErrorCode());
            $this->response->setContent($view->render());
        } catch (\Exception $ex) {
            $this->config->set('page_title', 'Error');

            $view = new View('exception');
            $view->exception = $ex;

            $this->response->setResponseCode(500);
            $this->response->setContent($view->render());
        }

        if ($this->response->hasLayout() && $this->controller->layout) {
            $this->setLayoutVariables($this->controller->layout);

            $this->controller->layout->content  = $this->response->getContent();
            $this->response->setContent($this->controller->layout->render());
        }

        return $this->response;
    }
54318
public function handle()
    {
        $response = '';

        try {
            // Set running mode
            $this->app->instance('mode', 'web');

            // App boot
            $this->app->boot();

            // Prepare request
            $request = $this->prepareRequest();

            // Preparar rotas
            $response = $this->runRoute($request);

        } catch (\Exception $e) {
            $this->reportException($e);

            $response = Router::toResponse($request, $this->renderException($request, $e));
        }

        // Call terminate
        $this->terminate($request, $response);

        return $response;
    }
875893
public function handle()
    {
        $scaffoldApi = $this->option('api');
        $webExecution = $this->option('webExecution');

        try
        {
            // Get all the models
            $modelFiles = File::allFiles(base_path('scaffolder-config/models/'));

            // Get app config
            $scaffolderConfig = Json::decodeFile(base_path('scaffolder-config/app.json'));

            $apiDirectory = strtolower(str_replace(' ', '-', $scaffolderConfig->name . '-api'));

            // Compilers
            $modelCompiler = new ModelCompiler();
            $apiModelCompiler = new ApiModelCompiler();
            $migrationCompiler = new MigrationCompiler();
            $controllerCompiler = new ControllerCompiler();
            $apiControllerCompiler = new ApiControllerCompiler();
            $indexViewCompiler = new IndexViewCompiler();
            $createViewCompiler = new CreateViewCompiler();
            $editViewCompiler = new EditViewCompiler();
            $dashboardViewCompiler = new DashboardViewCompiler();
            $welcomeViewCompiler = new WelcomeViewCompiler();
            $loginViewCompiler = new LoginViewCompiler();
            $pageLayoutViewCompiler = new PageLayoutCompiler();
            $createLayoutCompiler = new CreateLayoutCompiler();
            $editLayoutCompiler = new EditLayoutCompiler();
            $routeCompiler = new RouteCompiler();
            $apiRouteCompiler = new ApiRouteCompiler();

            // Compiler output
            $modelCompilerOutput = [];
            $apiModelCompilerOutput = [];
            $controllerCompilerOutput = [];
            $apiControllerCompilerOutput = [];
            $viewCompilerOutput = [];
            $migrationCompilerOutput = [];

            // Sidenav links
            $sidenavLinks = [];

            // Compiled routes
            $compiledRoutes = '';
            $compiledApiRoutes = '';

            // Get stubs
            $modelStub = File::get($this->stubsDirectory . 'Model.php');
            $apiModelStub = File::get($this->stubsDirectory . 'api/Model.php');
            $migrationStub = File::get($this->stubsDirectory . 'Migration.php');
            $controllerStub = File::get($this->stubsDirectory . 'Controller.php');
            $apiControllerStub = File::get($this->stubsDirectory . 'api/Controller.php');
            $indexViewStub = File::get($this->themeViews->getIndexPath());
            $createViewStub = File::get($this->themeViews->getCreatePath());
            $editViewStub = File::get($this->themeViews->getEditPath());
            $routeStub = File::get($this->stubsDirectory . 'ResourceRoute.php');
            $apiRouteStub = File::get($this->stubsDirectory . 'api/ResourceRoute.php');

            // Create models directory
            Directory::createIfNotExists(app_path('Models'));

            // Initialize API
            if ($scaffoldApi)
            {
                if (!(new \FilesystemIterator(base_path('../' . $apiDirectory)))->valid())
                {
                    $this->writeStatus('Initializing API ...', $webExecution);

                    $this->call('scaffolder:api-initialize', [
                        'name' => $scaffolderConfig->name,
                        'domain' => $scaffolderConfig->api->domain,
                        '--webExecution' => $webExecution
                    ]);

                    $this->output->newLine();
                }
                else
                {
                    $this->writeStatus('API already initialized', $webExecution);
                }

                // Create models directory
                Directory::createIfNotExists(base_path('../' . $apiDirectory . '/app/Models'));
            }

            $this->writeStatus('Compiling ...', $webExecution);
            $this->output->newLine();

            // Start progress bar
            $this->output->progressStart(count($modelFiles));

            // Iterate over model files
            foreach ($modelFiles as $modelFile)
            {
                // Get model name
                $modelName = ucwords($modelFile->getBasename('.' . $modelFile->getExtension()));

                // Get model data
                $modelData = Json::decodeFile($modelFile->getRealPath());

                // Create views directory
                Directory::createIfNotExists(base_path('resources/views/' . strtolower($modelName)));

                $modelHash = md5_file($modelFile->getRealPath());

                // Compile stubs
                array_push($modelCompilerOutput, $modelCompiler->compile($modelStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->extensions));
                if ($scaffoldApi) array_push($apiModelCompilerOutput, $apiModelCompiler->compile($apiModelStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->extensions));
                array_push($controllerCompilerOutput, $controllerCompiler->compile($controllerStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->extensions));
                if ($scaffoldApi) array_push($apiControllerCompilerOutput, $apiControllerCompiler->compile($apiControllerStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->extensions));
                array_push($migrationCompilerOutput, $migrationCompiler->compile($migrationStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->extensions));
                array_push($viewCompilerOutput, $indexViewCompiler->compile($indexViewStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->themeExtension, $this->extensions));
                array_push($viewCompilerOutput, $createViewCompiler->compile($createViewStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->themeExtension, $this->extensions));
                array_push($viewCompilerOutput, $editViewCompiler->compile($editViewStub, $modelName, $modelData, $scaffolderConfig, $modelHash, $this->themeExtension, $this->extensions));
                $compiledRoutes .= $routeCompiler->compile($routeStub, $modelName, $modelData, $scaffolderConfig, null, $this->extensions);
                if ($scaffoldApi) $compiledApiRoutes .= $apiRouteCompiler->compile($apiRouteStub, $modelName, $modelData, $scaffolderConfig, null, $this->extensions);

                // Add entity link
                array_push($sidenavLinks, ['modelName' => $modelName, 'modelLabel' => $modelData->modelLabel]);

                // Advance progress
                $this->output->progressAdvance();
            }

            // Finish progress
            $this->output->progressFinish();

            // Store compiled routes
            $routeCompiler->compileGroup(File::get($this->stubsDirectory . 'Routes.php'), $compiledRoutes, $scaffolderConfig);
            if ($scaffoldApi) $apiRouteCompiler->compileGroup(File::get($this->stubsDirectory . 'api/Routes.php'), $compiledApiRoutes, $scaffolderConfig);

            // Create layouts directory
            Directory::createIfNotExists(base_path('resources/views/layouts'));

            // Compile page layout
            array_push($viewCompilerOutput, $pageLayoutViewCompiler->compile(File::get($this->themeLayouts->getPagePath()), null, null, $scaffolderConfig, null, $this->themeExtension, $this->extensions, ['links' => $sidenavLinks]));

            // Compile create layout
            array_push($viewCompilerOutput, $createLayoutCompiler->compile(File::get($this->themeLayouts->getCreatePath()), null, null, $scaffolderConfig, null, $this->themeExtension, $this->extensions));

            // Compile edit layout
            array_push($viewCompilerOutput, $editLayoutCompiler->compile(File::get($this->themeLayouts->getEditPath()), null, null, $scaffolderConfig, null, $this->themeExtension, $this->extensions));

            // Compile dashboard view
            array_push($viewCompilerOutput, $dashboardViewCompiler->compile(File::get($this->themeViews->getDashboardPath()), null, null, $scaffolderConfig, null, $this->themeExtension, $this->extensions));

            // Compile welcome view
            array_push($viewCompilerOutput, $welcomeViewCompiler->compile(File::get($this->themeViews->getWelcomePath()), null, null, $scaffolderConfig, null, $this->themeExtension, $this->extensions));

            // Compile login view
            array_push($viewCompilerOutput, $loginViewCompiler->compile(File::get($this->themeViews->getLoginPath()), null, null, $scaffolderConfig, null, $this->themeExtension, $this->extensions));

            // Summary
            $this->comment('- Files created');

            $this->comment('- - Views');
            foreach ($viewCompilerOutput as $viewFile)
            {
                $this->info('- - - ' . $viewFile);
            }

            $this->comment('- - Controllers');
            foreach ($controllerCompilerOutput as $controllerFile)
            {
                $this->info('- - - ' . $controllerFile);
            }

            $this->comment('- - Migrations');
            foreach ($migrationCompilerOutput as $migrationFile)
            {
                $this->info('- - - ' . $migrationFile);
            }

            $this->comment('- - Models');
            foreach ($modelCompilerOutput as $modelFile)
            {
                $this->info('- - - ' . $modelFile);
            }

            if ($scaffoldApi)
            {
                $this->comment('- - API Controllers');
                foreach ($apiControllerCompilerOutput as $apiControllerFile)
                {
                    $this->info('- - - ' . $apiControllerFile);
                }

                $this->comment('- - API Models');
                foreach ($apiModelCompilerOutput as $apiModelFile)
                {
                    $this->info('- - - ' . $apiModelFile);
                }
            }

            $this->writeStatus('Done', $webExecution);
        }
        catch (\Exception $exception)
        {
            $this->writeStatus('Error', $webExecution);
            Log::error($exception->getMessage());
        }
    }
752316
public function handle()
    {
        $this->callSilent('route:clear');

        $app = $this->getFreshApplication();

        $this->call('route:cache');

        $routes = $app['api.router']->getAdapterRoutes();

        foreach ($routes as $collection) {
            foreach ($collection as $route) {
                $app['api.router.adapter']->prepareRouteForSerialization($route);
            }
        }

        $stub = "app('api.router')->setAdapterRoutes(unserialize(base64_decode('{{routes}}')));";
        $path = $this->laravel->getCachedRoutesPath();

        if (! $this->files->exists($path)) {
            $stub = "<?php\n\n$stub";
        }

        $this->files->append(
            $path,
            str_replace('{{routes}}', base64_encode(serialize($routes)), $stub)
        );
    }
107319
public function handle()
    {
        if (0 == count($this->routes)) {
            $this->error('Your application does not have any routes.');

            return;
        }

        $this->displayRoutes($this->getRoutes());
    }
209746
public function handle()
    {
        // Make sure we have everything we need from the form.
        $this->validate(request(), $this->rules());

        // Try to update the user's password.
        return $this->forgotPassword
            ->updatePassword(request('token'), request('email'), request('password'))
            ->redirect();
    }