当前位置: 首页>>代码示例>>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;未经允许,请勿转载。