App\Http\Controllers\AccountController::showOnlinePayments PHP Method

showOnlinePayments() private method

private showOnlinePayments ( ) : Illuminate\Contracts\View\View | Illuminate\Http\RedirectResponse
return Illuminate\Contracts\View\View | Illuminate\Http\RedirectResponse
    private function showOnlinePayments()
    {
        $account = Auth::user()->account;
        $account->load('account_gateways');
        $count = count($account->account_gateways);
        $trashedCount = AccountGateway::scope()->withTrashed()->count();
        if ($accountGateway = $account->getGatewayConfig(GATEWAY_STRIPE)) {
            if (!$accountGateway->getPublishableStripeKey()) {
                Session::flash('warning', trans('texts.missing_publishable_key'));
            }
        }
        if ($trashedCount == 0) {
            return Redirect::to('gateways/create');
        } else {
            $tokenBillingOptions = [];
            for ($i = 1; $i <= 4; $i++) {
                $tokenBillingOptions[$i] = trans("texts.token_billing_{$i}");
            }
            return View::make('accounts.payments', ['showAdd' => $count < count(Gateway::$alternate) + 1, 'title' => trans('texts.online_payments'), 'tokenBillingOptions' => $tokenBillingOptions, 'currency' => Utils::getFromCache(Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY), 'currencies'), 'account' => $account]);
        }
    }