App\Http\Controllers\AccountGatewayController::create PHP Method

create() public method

Displays the form for account creation
public create ( )
    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('sort_order')->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);
        }
    }