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


PHP PayPal::getById方法代碼示例

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


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

示例1: done

 public function done(Request $request)
 {
     $id = $request->get('paymentId');
     $payer_id = $request->get('PayerID');
     $payment = PayPal::getById($id, $this->_apiContext);
     $paymentExecution = PayPal::PaymentExecution();
     $paymentExecution->setPayerId($payer_id);
     $executePayment = $payment->execute($paymentExecution, $this->_apiContext);
     // Clear the shopping cart, write to database, send notifications, etc.
     $request->session()->pull('likes', []);
     return view('Main/index');
 }
開發者ID:unpetitlu,項目名稱:laravelcinema,代碼行數:12,代碼來源:MainController.php

示例2: getDone

 public function getDone(Request $request)
 {
     $id = $request->get('paymentId');
     $token = $request->get('token');
     $payer_id = $request->get('PayerID');
     $payment = PayPal::getById($id, $this->_apiContext);
     $paymentExecution = PayPal::PaymentExecution();
     $paymentExecution->setPayerId($payer_id);
     $executePayment = $payment->execute($paymentExecution, $this->_apiContext);
     \Cart::clear();
     return view('frontend.checkout.done')->with('categories', Category::all())->with('pay', $executePayment);
 }
開發者ID:nhatkhoa,項目名稱:GroupBuy,代碼行數:12,代碼來源:PaymentController.php

示例3: getDone

 public function getDone(Request $request)
 {
     $id = $request->get('paymentId');
     $token = $request->get('token');
     $payer_id = $request->get('PayerID');
     $payment = PayPal::getById($id, $this->_apiContext);
     $paymentExecution = PayPal::PaymentExecution();
     $paymentExecution->setPayerId($payer_id);
     $executePayment = $payment->execute($paymentExecution, $this->_apiContext);
     // Clear the shopping cart, write to database, send notifications, etc.
     // Thank the user for the purchase
     return view('register');
 }
開發者ID:aaffio,項目名稱:guide,代碼行數:13,代碼來源:paypalController.php

示例4: done

 /**
  * Done
  */
 public function done(Request $request)
 {
     //je recupere les informations de retour de Paypal
     $id = $request->get('paymentId');
     $token = $request->get('token');
     $payer_id = $request->get('PayerID');
     $payment = PayPal::getById($id, $this->_apiContext);
     $paymentExecution = PayPal::PaymentExecution();
     //execution du paiment a partir du Payer
     //Requete à Paypal: débit du montant de a transaction au Payer
     $paymentExecution->setPayerId($payer_id);
     $executePayment = $payment->execute($paymentExecution, $this->_apiContext);
     // Clear the shopping cart,
     $request->session()->pull('likes', []);
     // Write database
     // Thank the user for the purchase
     return view('Cart/success');
 }
開發者ID:unpetitlu,項目名稱:laravelcinema,代碼行數:21,代碼來源:CartController.php

示例5: getAgencyPaymentDone

 public function getAgencyPaymentDone(Request $request)
 {
     if (!\Session::has('_temp_payment_sess')) {
         return redirect(url('agency'))->with('flashMessage', ['class' => 'danger', 'message' => 'Your session has expired, please try again.']);
     }
     $data = session('_temp_payment_sess');
     $id = $request->get('paymentId');
     $token = $request->get('token');
     $payer_id = $request->get('PayerID');
     $payment = PayPal::getById($id, $this->paypalApiContext);
     $paymentExecution = PayPal::PaymentExecution();
     $paymentExecution->setPayerId($payer_id);
     $executePayment = $payment->execute($paymentExecution, $this->paypalApiContext);
     $agency = \Agency::getAgency();
     try {
         switch ($data['type']) {
             case 'credit':
                 \Agency::updateCredit($agency, $data['xCreditAmount']);
                 break;
             case 'contract':
                 \Agency::updateVIP($agency, true);
                 break;
             default:
                 break;
         }
         session(['_sess_agency' => ['model' => $agency]]);
         \Session::forget('_temp_payment_sess');
     } catch (\Exception $e) {
         // TODO: Need better error handler
         // re-run try with queue?
         \Session::forget('_temp_payment_sess');
         return redirect(url('agency'))->with('flashMessage', ['class' => 'danger', 'message' => $e->getMessage()]);
     }
     return redirect(url('agency'))->with('flashMessage', ['class' => 'success', 'message' => $data['successMessage']]);
 }
開發者ID:phantomlight,項目名稱:programme-chameleon,代碼行數:35,代碼來源:PaymentController.php


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