App\Http\Controllers\NinjaController::show_license_payment PHP Méthode

show_license_payment() public méthode

    public function show_license_payment()
    {
        if (Input::has('return_url')) {
            Session::set('return_url', Input::get('return_url'));
        }
        if (Input::has('affiliate_key')) {
            if ($affiliate = Affiliate::where('affiliate_key', '=', Input::get('affiliate_key'))->first()) {
                Session::set('affiliate_id', $affiliate->id);
            }
        }
        if (Input::has('product_id')) {
            Session::set('product_id', Input::get('product_id'));
        } else {
            if (!Session::has('product_id')) {
                Session::set('product_id', PRODUCT_ONE_CLICK_INSTALL);
            }
        }
        if (!Session::get('affiliate_id')) {
            return Utils::fatalError();
        }
        if (Utils::isNinjaDev() && Input::has('test_mode')) {
            Session::set('test_mode', Input::get('test_mode'));
        }
        $account = $this->accountRepo->getNinjaAccount();
        $account->load('account_gateways.gateway');
        $accountGateway = $account->getGatewayByType(GATEWAY_TYPE_CREDIT_CARD);
        $gateway = $accountGateway->gateway;
        $acceptedCreditCardTypes = $accountGateway->getCreditcardTypes();
        $affiliate = Affiliate::find(Session::get('affiliate_id'));
        $data = ['showBreadcrumbs' => false, 'hideHeader' => true, 'url' => 'license', 'amount' => $affiliate->price, 'client' => false, 'contact' => false, 'gateway' => $gateway, 'account' => $account, 'accountGateway' => $accountGateway, 'acceptedCreditCardTypes' => $acceptedCreditCardTypes, 'countries' => Cache::get('countries'), 'currencyId' => 1, 'currencyCode' => 'USD', 'paymentTitle' => $affiliate->payment_title, 'paymentSubtitle' => $affiliate->payment_subtitle, 'showAddress' => true];
        return View::make('payments.stripe.credit_card', $data);
    }