/** * Displays the form for account creation * */ public function create() { if (!\Request::secure() && !Utils::isNinjaDev()) { Session::flash('warning', trans('texts.enable_https')); } $account = Auth::user()->account; $accountGatewaysIds = $account->gatewayIds(); $otherProviders = Input::get('other_providers'); if (!Utils::isNinja() || !env('WEPAY_CLIENT_ID') || Gateway::hasStandardGateway($accountGatewaysIds)) { $otherProviders = true; } $data = self::getViewModel(); $data['url'] = 'gateways'; $data['method'] = 'POST'; $data['title'] = trans('texts.add_gateway'); if ($otherProviders) { $availableGatewaysIds = $account->availableGatewaysIds(); $data['primaryGateways'] = Gateway::primary($availableGatewaysIds)->orderBy('name', 'desc')->get(); $data['secondaryGateways'] = Gateway::secondary($availableGatewaysIds)->orderBy('name')->get(); $data['hiddenFields'] = Gateway::$hiddenFields; return View::make('accounts.account_gateway', $data); } else { return View::make('accounts.account_gateway_wepay', $data); } }