當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Redirect::away方法代碼示例

本文整理匯總了PHP中Redirect::away方法的典型用法代碼示例。如果您正苦於以下問題:PHP Redirect::away方法的具體用法?PHP Redirect::away怎麽用?PHP Redirect::away使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Redirect的用法示例。


在下文中一共展示了Redirect::away方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getStart

 function getStart($method = 'shopify', $shop = '', $id = 0)
 {
     $api = $this->integrationMethods->getMethodClass($method);
     $api->prepareAuth();
     \Session::put('integration_id', $id);
     return \Redirect::away($api->generateAuthUrl($shop));
 }
開發者ID:LasseRafn,項目名稱:Apricot-Printer,代碼行數:7,代碼來源:IntegrationController.php

示例2: login

 /**
  * 3rd party (redirect) OAuth based authentication
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function login()
 {
     $request_token_url = $this->build_url(self::F1_REQUEST_TOKEN_PATH);
     $request_token = $this->oauthClient->getRequestToken($request_token_url);
     $this->storeRequestToken($request_token);
     $login_url = $this->build_url(self::F1_PORTAL_LOGIN_PATH) . '?oauth_token=' . $request_token['oauth_token'] . '&oauth_callback=' . url(route('login'));
     return \Redirect::away($login_url);
 }
開發者ID:mcculley1108,項目名稱:admin.faithpromise.org,代碼行數:13,代碼來源:Client.php

示例3: postPayment

 public function postPayment()
 {
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     //        $item_1 = new Item();
     //        $item_1->setName('Item 1') // item name
     //            ->setCurrency('PHP')
     //            ->setQuantity('1')
     //            ->setPrice('0.01'); // unit price
     $package1 = Input::get('packname');
     $amount1 = Input::get('amount');
     $item_1 = new Item();
     $item_1->setName($package1)->setCurrency('PHP')->setQuantity('1')->setPrice($amount1);
     // unit price
     // add item to list
     $item_list = new ItemList();
     $item_list->setItems(array($item_1));
     $amount = new Amount();
     $amount->setCurrency('PHP')->setTotal($package1);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Your transaction description');
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(URL::route('payment.status'))->setCancelUrl(URL::route('payment.status'));
     $payment = new Payment();
     $payment->setIntent('Sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     //        try {
     //            $payment->create($this->_api_context);
     //        } catch (\PayPal\Exception\PPConnectionException $ex) {
     //
     //            if (\Config::get('app.debug')) {
     //                echo "Exception: " . $ex->getMessage() . PHP_EOL;
     //                $err_data = json_decode($ex->getData(), true);
     //                exit;
     //            } else {
     //                die('Some error occur, sorry for inconvenient');
     //            }
     //        }
     try {
         $payment->create($this->_api_context);
     } catch (PayPal\Exception\PayPalConnectionException $e) {
         echo $e->getData();
         // This will print a JSON which has specific details about the error.
         exit;
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     Session::put('paypal_payment_id', $payment->getId());
     if (isset($redirect_url)) {
         // redirect to paypal
         return Redirect::away($redirect_url);
     }
     return Redirect::route('original.route')->with('error', 'Unknown error occurred');
 }
開發者ID:axisssss,項目名稱:ORS,代碼行數:58,代碼來源:IndexController.php

示例4: getKibana

 /** @inheritdoc */
 public function getKibana()
 {
     $url = env('DFE_AUDIT_CLIENT_HOST') ? env('DFE_AUDIT_CLIENT_HOST') : env('DFE_AUDIT_HOST');
     $url .= ':' . (env('DFE_AUDIT_CLIENT_PORT') ? env('DFE_AUDIT_CLIENT_PORT') : '5601');
     if (strpos($url, 'http') === false) {
         $url = env('DFE_DEFAULT_DOMAIN_PROTOCOL') . '://' . $url;
     }
     return \Redirect::away($url);
 }
開發者ID:rajeshpillai,項目名稱:dfe-console,代碼行數:10,代碼來源:ReportController.php

示例5: authenticated

 protected function authenticated($request, $user)
 {
     $continue = \Input::get('continue');
     if ($continue) {
         return \Redirect::away($continue);
     } else {
         return redirect()->intended($this->redirectPath());
     }
 }
開發者ID:prkeshri,項目名稱:getpanel,代碼行數:9,代碼來源:AuthController.php

示例6: postPayment

 public function postPayment()
 {
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $items = array();
     $subtotal = 0;
     $cart = \Session::get('cart');
     $currency = 'MXN';
     foreach ($cart as $producto) {
         $item = new Item();
         $item->setName($producto->name)->setCurrency($currency)->setDescription($producto->extract)->setQuantity($producto->quantity)->setPrice($producto->price);
         $items[] = $item;
         $subtotal += $producto->quantity * $producto->price;
     }
     $item_list = new ItemList();
     $item_list->setItems($items);
     //costo de envio de la compra
     $details = new Details();
     $details->setSubtotal($subtotal)->setShipping(100);
     //total de envio sumando el subtotal mas el envio
     $total = $subtotal + 100;
     $amount = new Amount();
     $amount->setCurrency($currency)->setTotal($total)->setDetails($details);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Pedido de prueba con laravel para La Central Mueblera');
     //la ruta  para direccionar si se cancela o se envia conrectamente el pedido
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(\URL::route('payment.status'))->setCancelUrl(\URL::route('payment.status'));
     $payment = new Payment();
     $payment->setIntent('Sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     try {
         $payment->create($this->_api_context);
     } catch (\PayPal\Exception\PPConnectionException $ex) {
         if (\Config::get('app.debug')) {
             echo "Exception: " . $ex->getMessage() . PHP_EOL;
             $err_data = json_decode($ex->getData(), true);
             exit;
         } else {
             die('Ups! Algo salió mal');
         }
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     \Session::put('paypal_payment_id', $payment->getId());
     if (isset($redirect_url)) {
         // redirect to paypal
         return \Redirect::away($redirect_url);
     }
     return \Redirect::route('cart-show')->with('error', 'Ups! Error desconocido.');
 }
開發者ID:Rotron,項目名稱:carrito_laravel_51,代碼行數:55,代碼來源:PaypalController.php

示例7: facebookSqueeb

 public function facebookSqueeb($id)
 {
     //update the number of shared times
     $squeeb = Lecture::where('id', '=', $id);
     if ($squeeb->count()) {
         $squeeb = $squeeb->first();
         if ($squeeb->save()) {
             return Redirect::away('https://www.facebook.com/sharer.php?u={{URL::current()}}');
         }
     }
 }
開發者ID:franqq,項目名稱:plmas,代碼行數:11,代碼來源:ShareController.php

示例8: postPayment

 public function postPayment()
 {
     $name = 'Transaction';
     /*$mmnumber      = Input::get('number');
       $amounttosend     = Input::get('amount');
       $currency   = Input::get('currency');*/
     $mmnumber = Input::get('number');
     $amounttosend = Input::get('amount');
     $currency = Input::get('currency');
     $charges = new PlatformCharges($amounttosend, $currency);
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $item_1 = new Item();
     $item_1->setName('Transaction')->setCurrency('USD')->setQuantity(1)->setPrice((int) $charges->getDueAmountForPayPalToMobileMoney());
     // unit price
     // add item to list
     $item_list = new ItemList();
     $item_list->setItems(array($item_1));
     $amount = new Amount();
     $amount->setCurrency('USD')->setTotal((int) $charges->getDueAmountForPayPalToMobileMoney());
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Send money To a Mobile Money User');
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(URL::route('payment-status'))->setCancelUrl(URL::route('payment-status'));
     $payment = new Payment();
     $payment->setIntent('sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     try {
         $payment->create($this->_api_context);
     } catch (\PayPal\Exception\PPConnectionException $ex) {
         if (\Config::get('app.debug')) {
             echo "Exception: " . $ex->getMessage() . PHP_EOL;
             $err_data = json_decode($ex->getData(), true);
             exit;
         } else {
             die('Some error occurred, sorry for inconvenient');
         }
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     Session::put('paypal_payment_id', $payment->getId());
     if (isset($redirect_url)) {
         // redirect to paypal
         return Redirect::away($redirect_url);
     }
     return "Error!!!!";
     /*Redirect::route('original.route')
       ->with('error', 'Unknown error occurred'); */
 }
開發者ID:lewisitor,項目名稱:icepay,代碼行數:53,代碼來源:PaymentController.php

示例9: postPayment

 public function postPayment()
 {
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $item_1 = new Item();
     $item_1->setName('Item 1')->setCurrency('USD')->setQuantity(2)->setPrice('150');
     // unit price
     $item_2 = new Item();
     $item_2->setName('Item 2')->setCurrency('USD')->setQuantity(4)->setPrice('70');
     $item_3 = new Item();
     $item_3->setName('Item 3')->setCurrency('USD')->setQuantity(1)->setPrice('20');
     // add item to list
     $item_list = new ItemList();
     $item_list->setItems(array($item_1, $item_2, $item_3));
     $amount = new Amount();
     $amount->setCurrency('USD')->setTotal(580);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Your transaction description');
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(URL::route('payment.status'))->setCancelUrl(URL::route('payment.status'));
     $payment = new Payment();
     $payment->setIntent('Sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     try {
         $payment->create($this->_api_context);
         //            echo'hello';
         //            print_r($test);die;
     } catch (\PayPal\Exception\PPConnectionException $ex) {
         if (\Config::get('app.debug')) {
             echo "Exception: " . $ex->getMessage() . PHP_EOL;
             $err_data = json_decode($ex->getData(), true);
             exit;
         } else {
             die('Some error occur, sorry for inconvenient');
         }
     }
     if (is_array($payment->getLinks()) || is_object($payment->getLinks())) {
         foreach ($payment->getLinks() as $link) {
             echo 'reached';
             if ($link->getRel() == 'approval_url') {
                 $redirect_url = $link->getHref();
                 break;
             }
         }
     }
     // add payment ID to session
     Session::put('paypal_payment_id', $payment->getId());
     dd(Session::all());
     if (isset($redirect_url)) {
         // redirect to paypal
         return Redirect::away($redirect_url);
     }
     return Redirect::route('original.route')->with('error', 'Unknown error occurred');
 }
開發者ID:sumitglobussoft,項目名稱:INSTAGRAM-PANEL,代碼行數:53,代碼來源:PaypalController.php

示例10: insert_or_update

 function insert_or_update($page_name, $mode = '+')
 {
     $page = unref(Page::import($page_name));
     if ($r = $this->user_accessibility($page, $mode)) {
         return $r;
     }
     $table_values = Input::get('v');
     if ($mode == '.') {
         $input_d_1 = Input::get('d');
     }
     foreach ($table_values as $table_name => $values) {
         $table = $page->table($table_name);
         $res = FALSE;
         foreach ($values as $col_name => $col_value) {
             if (isset($col_value['null'])) {
                 $res1 = $table->col($col_name)->set_client_value($new_value = NULL);
             } else {
                 $res1 = $table->col($col_name)->set_client_value($new_value = $col_value['value']);
             }
             if (!$res) {
                 $res = $res1;
             }
             if ($mode == '.' && isset($input_d_1[$table_name][$col_name])) {
                 $input_d_1[$table_name][$col_name] = $new_value;
             }
         }
         if ($res) {
             if ($mode == '+') {
                 $res = $table->insert_from_client_values();
                 if ($res) {
                     return \Redirect::back()->with('message_type', 'success')->with('message', 'Successfully Saved!')->with('other_data', ['opener_refresh' => true]);
                 }
             } else {
                 if ($mode == '.') {
                     $input_d = Input::get('d');
                     if (!$input_d[$table_name]) {
                         return view('panel.errors.5xx', ['msg' => 'Table with no primary keys cannot be updated!']);
                     }
                     $res = $table->update_from_client_values_and_edit_args($input_d[$table_name]);
                     if ($res) {
                         return \Redirect::away(action('PageController@getEdit', [$page_name]) . '?' . http_build_query(['d' => $input_d_1]))->with('message_type', 'success')->with('message', 'Successfully Saved!')->with('other_data', ['opener_refresh' => true]);
                     } else {
                         return \Redirect::away(action('PageController@getEdit', [$page_name]) . '?' . http_build_query(['d' => $input_d_1]))->with('message_type', 'warning')->with('message', 'Nothing to save!');
                     }
                 }
             }
         } else {
             return \Redirect::back()->with('message_type', 'warning')->with('message', 'Nothing to save!');
         }
         return \Redirect::back()->with('message_type', 'danger')->with('message', 'Cannot Save! Some error has occurred!');
     }
 }
開發者ID:prkeshri,項目名稱:getpanel,代碼行數:52,代碼來源:PageController.php

示例11: postPayment

 public function postPayment()
 {
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $items = array();
     $subtotal = 0;
     $cart = \Session::get('cart');
     $currency = 'USD';
     foreach ($cart as $producto) {
         $item = new Item();
         $item->setName($producto->tipograno)->setCurrency($currency)->setDescription($producto->descripcion)->setQuantity($producto->cantidad)->setPrice($producto->precio);
         $items[] = $item;
         $subtotal += $producto->cantidad * $producto->precio;
     }
     $item_list = new ItemList();
     $item_list->setItems($items);
     $total = $subtotal;
     $amount = new Amount();
     $amount->setCurrency($currency)->setTotal($total);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Pedido de prueba en Agricola Grain App');
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(\URL::route('payment.status'))->setCancelUrl(\URL::route('payment.status'));
     $payment = new Payment();
     $payment->setIntent('Sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     try {
         $payment->create($this->_api_context);
     } catch (\PayPal\Exception\PPConnectionException $ex) {
         if (\Config::get('app.debug')) {
             echo "Exception: " . $ex->getMessage() . PHP_EOL;
             $err_data = json_decode($ex->getData(), true);
             exit;
         } else {
             die('Ups! Algo salió mal');
         }
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     \Session::put('paypal_payment_id', $payment->getId());
     if (isset($redirect_url)) {
         // redirect to paypal
         return \Redirect::away($redirect_url);
     }
     return \Redirect::route('cart-show')->with('error', 'Ups! Error desconocido.');
 }
開發者ID:soygalla,項目名稱:Grain,代碼行數:50,代碼來源:VentaController.php

示例12: getRedirect

 public function getRedirect($username, $id)
 {
     $link = Link::where('id', '=', $id)->first();
     /*Get user ip address*/
     $ip_address = $_SERVER['REMOTE_ADDR'];
     $device = Device::where('ip', '=', $ip_address);
     if (!$device->count()) {
         //record the device
         $user = Device::create(array('ip' => $ip_address));
         $link->clicks = $link->clicks + 1;
         $link_save = $link->save();
     }
     return Redirect::away($link->link_name);
 }
開發者ID:franqq,項目名稱:openAdvertiser,代碼行數:14,代碼來源:NavigateController.php

示例13: pay

 public function pay()
 {
     #dd(Input::all());
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $counter = 0;
     $items = [];
     foreach (Input::all() as $input) {
         if (Input::has('item_name' . $counter)) {
             $item = new Item();
             $item->setName(Input::get('item_name' . $counter))->setCurrency('EUR')->setQuantity(Input::get('item_qtt' . $counter))->setPrice(Input::get('item_price' . $counter));
             $items[] = $item;
         }
         $counter++;
     }
     $item_list = new ItemList();
     $item_list->setItems($items);
     $amount = new Amount();
     $amount->setCurrency('EUR')->setTotal(Input::get('total'));
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('This is just a demo transaction');
     $redirect_url = new RedirectUrls();
     $redirect_url->setReturnUrl(URL::route('paymentStatus'))->setCancelUrl(URL::route('paymentStatus'));
     $payment = new Payment();
     $payment->setIntent('sale')->setPayer($payer)->setRedirectUrls($redirect_url)->setTransactions(array($transaction));
     try {
         $payment->create($this->_api_context);
     } catch (\PayPal\Exception\PPConnectionException $ex) {
         if (\Config::get('app.debug')) {
             echo "Exception: " . $ex->getMessage() . PHP_EOL;
             $err_data = json_decode($ex->getData(), true);
             exit;
         } else {
             die('Some error occur, sorry for inconvenient');
         }
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     Session::put('paypal_payment_id', $payment->getId());
     if (isset($redirect_url)) {
         // redirect to paypal
         return Redirect::away($redirect_url);
     }
     return Redirect::route('original.route')->with('error', 'Unknown error occurred');
 }
開發者ID:Pixelsltd,項目名稱:e-commerce-1,代碼行數:50,代碼來源:PaypalController.php

示例14: postPayment

 public function postPayment()
 {
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $items = array();
     $subtotal = 0;
     $cart = \Session::get('product');
     $currency = 'USD';
     $item = new Item();
     $item->setName($cart->name)->setCurrency($currency)->setDescription($cart->description)->setQuantity(1)->setPrice($cart->price);
     $items[] = $item;
     $subtotal += $cart->price;
     $item_list = new ItemList();
     $item_list->setItems($items);
     $details = new Details();
     $details->setSubtotal($subtotal)->setShipping(0);
     $total = $subtotal + 0;
     $amount = new Amount();
     $amount->setCurrency($currency)->setTotal($total)->setDetails($details);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Order plan in hdsports.in');
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(\URL::route('payment.status'))->setCancelUrl(\URL::route('payment.status'));
     $payment = new Payment();
     $payment->setIntent('Sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     try {
         $payment->create($this->_api_context);
     } catch (\PayPal\Exception\PPConnectionException $ex) {
         if (\Config::get('app.debug')) {
             echo "Exception: " . $ex->getMessage() . PHP_EOL;
             $err_data = json_decode($ex->getData(), true);
             exit;
         } else {
             die('Ups! something went wrong');
         }
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     \Session::put('paypal_payment_id', $payment->getId());
     if (isset($redirect_url)) {
         // redirect to paypal
         return \Redirect::away($redirect_url);
     }
     return \Redirect::to('/')->with('message', 'Ups! Unknown mistake.');
 }
開發者ID:joseferrer1090,項目名稱:hdsport,代碼行數:50,代碼來源:PaypalController.php

示例15: postPayment

 public function postPayment()
 {
     // echo '123123';exit;
     $payer = new Payer();
     $payer->setPaymentMethod('paypal');
     $total = Input::get('total');
     $qty = Input::get('qty');
     $price = Input::get('price');
     $bill_id = Input::get('bill_id');
     $item_1 = new Item();
     $item_1->setName(Input::get('service_name'))->setCurrency('USD')->setQuantity($qty)->setPrice($price);
     // unit price
     // add item to list
     $item_list = new ItemList();
     $item_list->setItems(array($item_1));
     $amount = new Amount();
     $amount->setCurrency('USD')->setTotal($total);
     $transaction = new Transaction();
     $transaction->setAmount($amount)->setItemList($item_list)->setDescription('Your transaction description');
     $redirect_urls = new RedirectUrls();
     $redirect_urls->setReturnUrl(URL::route('payment.status'))->setCancelUrl(URL::route('payment.status'));
     $payment = new Payment();
     $payment->setIntent('Sale')->setPayer($payer)->setRedirectUrls($redirect_urls)->setTransactions(array($transaction));
     try {
         $payment->create($this->_api_context);
     } catch (\PayPal\Exception\PPConnectionException $ex) {
         if (\Config::get('app.debug')) {
             echo "Exception: " . $ex->getMessage() . PHP_EOL;
             $err_data = json_decode($ex->getData(), true);
             exit;
         } else {
             die('Some error occur, sorry for inconvenient');
         }
     }
     foreach ($payment->getLinks() as $link) {
         if ($link->getRel() == 'approval_url') {
             $redirect_url = $link->getHref();
             break;
         }
     }
     // add payment ID to session
     Session::put('paypal_payment_id', $payment->getId());
     Session::put('bill_id', $bill_id);
     if (isset($redirect_url)) {
         // redirect to paypal
         return Redirect::away($redirect_url);
     }
     return Redirect::route('original.route')->with('error', 'Unknown error occurred');
 }
開發者ID:EricBui0512,項目名稱:FYP,代碼行數:49,代碼來源:PaymentController.php


注:本文中的Redirect::away方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。