/**
  * This url is called when a SEOshop customer installs this application
  *
  * @param Request $request
  * @return \Illuminate\View\View
  * @throws \Exception
  */
 public function install(Request $request)
 {
     // Make sure we have received all required information
     $this->validate($request, ['language' => 'required', 'shop_id' => 'required', 'signature' => 'required', 'timestamp' => 'required', 'token' => 'required']);
     // Validate the signature
     $signature = '';
     $input = $request->except('signature');
     ksort($input);
     // Construct the signature
     foreach ($input as $key => $value) {
         $signature .= $key . '=' . $value;
     }
     // The signature contains the app secret
     $signature = md5($signature . config('services.seoshop.secret'));
     // Do the signatures match?
     if ($signature != $request->input('signature')) {
         throw new \Exception('The signature does not match. You haven\'t secretly tampered with it no?');
     }
     // Find or create the user
     $shop = Shop::firstOrNew(array('shop_id' => $request->input('shop_id')));
     $shop->language = $request->input('language');
     $shop->token = $request->input('token');
     $shop->save();
     // Authenticate the user
     Auth::loginUsingId($shop->id);
     // Create the external services
     Webshop::instance()->installExternalServices();
     // Were done here
     return redirect('dashboard');
 }