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


PHP Am_Paysystem_Result::isFailure方法代碼示例

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


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

示例1: process

 /**
  * This function is likely never returns
  * but anyway handle result and exceptions
  * @return Am_Paysystem_Result
  */
 function process()
 {
     Am_Di::getInstance()->hook->call(Am_Event::INVOICE_BEFORE_PAYMENT, array('invoice' => $this->invoice, 'controller' => $this->controller));
     $plugin = Am_Di::getInstance()->plugins_payment->loadGet($this->invoice->paysys_id);
     $this->result = new Am_Paysystem_Result();
     $plugin->processInvoice($this->invoice, $this->controller->getRequest(), $this->result);
     if ($this->result->isSuccess() || $this->result->isFailure()) {
         if ($transaction = $this->result->getTransaction()) {
             $transaction->setInvoice($this->invoice);
             $transaction->process();
         }
     }
     if ($this->result->isSuccess()) {
         if (method_exists($this->controller, 'getForm')) {
             $this->controller->getForm()->getSessionContainer()->destroy();
         }
         $url = REL_ROOT_URL . "/thanks?id=" . $this->invoice->getSecureId('THANKS');
         $this->callback($this->onSuccess);
         $this->controller->redirectLocation($url);
         // no return
         // Am_Exception_Redirect only for APPLICATION_ENV = 'testing'
     } elseif ($this->result->isAction()) {
         if (method_exists($this->controller, 'getForm')) {
             $this->controller->getForm()->getSessionContainer()->destroy();
         }
         $this->callback($this->onAction);
         $this->result->getAction()->process($this->controller);
         // no return
         // Am_Exception_Redirect only for APPLICATION_ENV = 'testing'
     } else {
         //  ($result->isFailure()) {
         $this->callback($this->onFailure);
     }
     return $this->result;
 }
開發者ID:irovast,項目名稱:eyedock,代碼行數:40,代碼來源:PayProcessMediator.php

示例2: process

 /**
  * This function is likely never returns
  * but anyway handle result and exceptions
  * @return Am_Paysystem_Result
  */
 function process()
 {
     $err = $this->invoice->validate();
     if ($err) {
         throw new Am_Exception_InputError($err[0]);
     }
     $this->invoice->save();
     $plugin = Am_Di::getInstance()->plugins_payment->loadGet($this->invoice->paysys_id);
     $this->result = new Am_Paysystem_Result();
     $plugin->processInvoice($this->invoice, $this->controller->getRequest(), $this->result);
     if ($this->result->isSuccess() || $this->result->isFailure()) {
         if ($transaction = $this->result->getTransaction()) {
             $transaction->setInvoice($this->invoice);
             $transaction->process();
         }
     }
     if ($this->result->isSuccess()) {
         $url = REL_ROOT_URL . "/thanks?id=" . $this->invoice->getSecureId('THANKS');
         $this->callback($this->onSuccess);
         $this->controller->redirectLocation($url, ___("Invoice processed"), ___("Invoice processed successfully"));
         // no return Am_Exception_Redirect
     } elseif ($this->result->isAction()) {
         $this->callback($this->onAction);
         $this->result->getAction()->process($this->controller);
         // no return Am_Exception_Redirect
     } else {
         //  ($result->isFailure()) {
         $this->callback($this->onFailure);
     }
     return $this->result;
 }
開發者ID:subashemphasize,項目名稱:test_site,代碼行數:36,代碼來源:PayProcessMediator.php

示例3: run

 public function run(Am_Paysystem_Result $result)
 {
     $this->result = $result;
     $log = $this->getInvoiceLog();
     $log->add($this->request);
     $this->response = $this->request->send();
     $log->add($this->response);
     $this->validateResponseStatus($this->result);
     if ($this->result->isFailure()) {
         return;
     }
     try {
         $this->parseResponse();
         // validate function must set success status
         $this->validate();
         if ($this->result->isSuccess()) {
             $this->processValidated();
         }
     } catch (Exception $e) {
         if ($e instanceof PHPUnit_Framework_Error) {
             throw $e;
         }
         if ($e instanceof PHPUnit_Framework_Asser) {
             throw $e;
         }
         if (!$result->isFailure()) {
             $result->setFailed(___("Payment failed"));
         }
         $log->add($e);
     }
 }
開發者ID:irovast,項目名稱:eyedock,代碼行數:31,代碼來源:Echeck.php

示例4: run

 public function run(Am_Paysystem_Result $result)
 {
     $this->result = $result;
     $log = $this->getInvoiceLog();
     $request = $this->getRequest();
     $log->add($request);
     $this->paysystemResponse = $this->submitTransaction($request);
     $log->add($this->paysystemResponse);
     if ($this->paysystemResponse->success) {
         try {
             $result->setSuccess($this);
             $this->processValidated();
         } catch (Exception $e) {
             if ($e instanceof PHPUnit_Framework_Error) {
                 throw $e;
             }
             if ($e instanceof PHPUnit_Framework_Asser) {
                 throw $e;
             }
             if (!$result->isFailure()) {
                 $result->setFailed(___("Payment failed"));
             }
             $log->add($e);
         }
     } else {
         if ($errors = $this->paysystemResponse->errors->deepAll()) {
             if (!is_array($errors)) {
                 $errors = array($errors);
             }
             foreach ($errors as $error) {
                 $error_text .= $error->message;
             }
             $result->setFailed("Error: " . $errors);
         } else {
             if ($this->paysystemResponse->transaction->status == 'processor_declined') {
                 $result->setFailed("Declined: " . $this->paysystemResponse->transaction->processorResponseText);
             } else {
                 $result->setFailed("Gateway Rejected: " . $this->paysystemResponse->transaction->gatewayRejectionReason);
             }
         }
     }
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:42,代碼來源:braintree.php

示例5: run

 public function run(Am_Paysystem_Result $result)
 {
     $this->result = $result;
     $log = $this->getInvoiceLog();
     try {
         $soapClient = new SoapClient_Cybersource($this->getPlugin());
     } catch (Exception $ex) {
         throw new Am_Exception_InternalError("Cannot create soapclient object: " . $ex->getMessage());
     }
     $soapResult = $soapClient->runTransaction($this->soapData);
     $this->response = json_decode(json_encode($soapResult), true);
     $log->add($this->response);
     $this->validateResponseStatus($this->result);
     if ($this->result->isFailure()) {
         return;
     }
     try {
         $this->parseResponse();
         $this->validate();
         if ($this->result->isSuccess()) {
             $this->processValidated();
         }
     } catch (Exception $e) {
         if ($e instanceof PHPUnit_Framework_Error) {
             throw $e;
         }
         if ($e instanceof PHPUnit_Framework_Asser) {
             throw $e;
         }
         if (!$result->isFailure()) {
             $result->setFailed(___("Payment failed"));
         }
         $log->add($e);
     }
 }
開發者ID:alexanderTsig,項目名稱:arabic,代碼行數:35,代碼來源:cybersource.php


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