Пример #1
0
 /**
  * @return $this|\Illuminate\Contracts\View\View
  */
 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);
 }
 /**
  * @return mixed
  */
 public function doRegister()
 {
     $affiliate = Affiliate::where('affiliate_key', '=', SELF_HOST_AFFILIATE_KEY)->first();
     $email = trim(Input::get('email'));
     if (!$email || $email == TEST_USERNAME) {
         return RESULT_FAILURE;
     }
     $license = new License();
     $license->first_name = Input::get('first_name');
     $license->last_name = Input::get('last_name');
     $license->email = $email;
     $license->transaction_reference = Request::getClientIp();
     $license->license_key = Utils::generateLicense();
     $license->affiliate_id = $affiliate->id;
     $license->product_id = PRODUCT_SELF_HOST;
     $license->is_claimed = 1;
     $license->save();
     return RESULT_SUCCESS;
 }
 public function doRegister()
 {
     $affiliate = Affiliate::where('affiliate_key', '=', SELF_HOST_AFFILIATE_KEY)->first();
     $license = new License();
     $license->first_name = Input::get('first_name');
     $license->last_name = Input::get('last_name');
     $license->email = Input::get('email');
     $license->transaction_reference = Request::getClientIp();
     $license->license_key = Utils::generateLicense();
     $license->affiliate_id = $affiliate->id;
     $license->product_id = PRODUCT_SELF_HOST;
     $license->is_claimed = 1;
     $license->save();
     return '';
 }