示例#1
0
 public function action_complete()
 {
     PayPal::execute($this->request->PayerID, $this->request->param('trxid'));
 }
示例#2
0
 protected function getAttemptInfo($isSave = false)
 {
     fb('PayPal getAttemptInfo');
     $successAttemptCustomData = json_decode($this->attemptModel->custom_data, true);
     $options = array('username' => $this->gatewayModel->username, 'password' => $this->gatewayModel->routing_number, 'signature' => $this->gatewayModel->shared_secret);
     $transaction = new PayPal($options);
     if (self::$isTest) {
         $transaction->setIsProduction(false);
     }
     $transaction->set('TRANSACTIONID', $successAttemptCustomData['tracking_number']);
     $transaction->status();
     try {
         $response = $transaction->execute();
         fb($response);
     } catch (Exception $e) {
         $aErrors = array('Error processing your request');
         $this->attemptError($aErrors);
         return false;
     }
     //...
     if ($isSave) {
         $this->attemptModel->save();
     }
     return true;
 }