当前位置: 首页>>代码示例>>PHP>>正文


PHP LogPagSeguro::info方法代码示例

本文整理汇总了PHP中LogPagSeguro::info方法的典型用法代码示例。如果您正苦于以下问题:PHP LogPagSeguro::info方法的具体用法?PHP LogPagSeguro::info怎么用?PHP LogPagSeguro::info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LogPagSeguro的用法示例。


在下文中一共展示了LogPagSeguro::info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getInstallments

 /**
  * Get from webservice installments for direct payment.
  * @param PagSeguroCredentials $credentials
  * @param $amount
  * @param $cardBrand
  * @param $maxInstallmentNoInterest
  * @return bool|PagSeguroInstallment
  * @throws Exception
  * @throws PagSeguroServiceException
  */
 public static function getInstallments(PagSeguroCredentials $credentials, $amount, $cardBrand = null, $maxInstallmentNoInterest = null)
 {
     $amount = PagSeguroHelper::decimalFormat($amount);
     LogPagSeguro::info("PagSeguroInstallmentService.getInstallments(" . $amount . ") - begin");
     self::$connectionData = new PagSeguroConnectionData($credentials, self::SERVICE_NAME);
     try {
         $connection = new PagSeguroHttpConnection();
         $connection->get(self::buildInstallmentURL(self::$connectionData, $amount, $cardBrand, $maxInstallmentNoInterest), self::$connectionData->getServiceTimeout(), self::$connectionData->getCharset());
         $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 $installments = PagSeguroInstallmentParser::readInstallments($connection->getResponse());
                 LogPagSeguro::info("PagSeguroInstallmentService.getInstallments() - end ");
                 break;
             case 'BAD_REQUEST':
                 $errors = PagSeguroInstallmentParser::readErrors($connection->getResponse());
                 $e = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::error("PagSeguroInstallmentService.getInstallments() - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
             default:
                 $e = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::error("PagSeguroInstallmentService.getInstallments() - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
         }
         return isset($installments) ? $installments : false;
     } catch (PagSeguroServiceException $e) {
         throw $e;
     } catch (Exception $e) {
         LogPagSeguro::error("Exception: " . $e->getMessage());
         throw $e;
     }
 }
开发者ID:KikoPoaRS,项目名称:mudamuda,代码行数:44,代码来源:PagSeguroInstallmentService.class.php

示例2: createRequest

 /**
  * @param PagSeguroCredentials $credentials
  * @param $transactionCode
  * @throws Exception
  * @throws PagSeguroServiceException
  */
 public static function createRequest(PagSeguroCredentials $credentials, $transactionCode)
 {
     LogPagSeguro::info("PagSeguroCancelService.Register(" . $transactionCode . ") - begin");
     $connectionData = new PagSeguroConnectionData($credentials, self::SERVICE_NAME);
     try {
         $connection = new PagSeguroHttpConnection();
         $connection->post(self::buildCancelURL($connectionData, $transactionCode), array(), $connectionData->getServiceTimeout(), $connectionData->getCharset());
         $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 $result = PagSeguroCancelParser::readSuccessXml($connection->getResponse());
                 LogPagSeguro::info("PagSeguroCancelService.createRequest(" . $result . ") - end ");
                 break;
             case 'BAD_REQUEST':
                 $errors = PagSeguroCancelParser::readErrors($connection->getResponse());
                 $err = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::error("PagSeguroCancelService.createRequest() - error " . $err->getOneLineMessage());
                 throw $err;
                 break;
             default:
                 $err = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::error("PagSeguroCancelService.createRequest() - error " . $err->getOneLineMessage());
                 throw $err;
                 break;
         }
         return isset($result) ? $result : false;
     } catch (PagSeguroServiceException $err) {
         throw $err;
     } catch (Exception $err) {
         LogPagSeguro::error("Exception: " . $err->getMessage());
         throw $err;
     }
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:39,代码来源:PagSeguroCancelService.class.php

示例3: checkTransaction

 /**
  * Returns a transaction from a notification code
  * 
  * @param PagSeguroCredentials $credentials
  * @param String $notificationCode
  * @throws PagSeguroServiceException
  * @throws Exception
  * @return a transaction
  * @see PagSeguroTransaction
  */
 public static function checkTransaction(PagSeguroCredentials $credentials, $notificationCode)
 {
     LogPagSeguro::info("PagSeguroNotificationService.CheckTransaction(notificationCode={$notificationCode}) - begin");
     $connectionData = new PagSeguroConnectionData($credentials, self::serviceName);
     try {
         $connection = new PagSeguroHttpConnection();
         $connection->get(self::buildTransactionNotificationUrl($connectionData, $notificationCode), $connectionData->getServiceTimeout(), $connectionData->getCharset());
         $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 // parses the transaction
                 $transaction = PagSeguroTransactionParser::readTransaction($connection->getResponse());
                 LogPagSeguro::info("PagSeguroNotificationService.CheckTransaction(notificationCode={$notificationCode}) - end " . $transaction->toString() . ")");
                 break;
             case 'BAD_REQUEST':
                 $errors = PagSeguroTransactionParser::readErrors($connection->getResponse());
                 $e = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::info("PagSeguroNotificationService.CheckTransaction(notificationCode={$notificationCode}) - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
             default:
                 $e = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::info("PagSeguroNotificationService.CheckTransaction(notificationCode={$notificationCode}) - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
         }
         return isset($transaction) ? $transaction : null;
     } catch (PagSeguroServiceException $e) {
         throw $e;
     } catch (Exception $e) {
         LogPagSeguro::error("Exception: " . $e->getMessage());
         throw $e;
     }
 }
开发者ID:muratgoktuna,项目名称:joomla-payments,代码行数:44,代码来源:PagSeguroNotificationService.class.php

示例4: getSession

 public static function getSession($credentials)
 {
     $connectionData = new PagSeguroConnectionData($credentials, 'sessionService');
     $url = self::buildSessionURL($connectionData) . "?" . $connectionData->getCredentialsUrlQuery();
     try {
         $connection = new PagSeguroHttpConnection();
         $connection->post($url, array(), $connectionData->getServiceTimeout(), $connectionData->getCharset());
         $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 $session = PagSeguroSessionParser::readResult($connection->getResponse());
                 return $session->getId();
                 LogPagSeguro::info("PagSeguroSessionService.getSession()(" . $session->toString() . ") - end {1}");
                 break;
             case 'BAD_REQUEST':
                 $errors = PagSeguroSessionParser::readErrors($connection->getStatus());
                 $e = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::error("PagSeguroSessionService.getSession() - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
             default:
                 $e = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::error("PagSeguroSessionService.getSession() - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
         }
     } catch (PagSeguroServiceException $e) {
         throw $e;
     } catch (Exception $e) {
         LogPagSeguro::error("Exception: " . $e->getMessage());
         throw $e;
     }
 }
开发者ID:caina,项目名称:pando,代码行数:33,代码来源:PagSeguroSessionService.class.php

示例5: createCheckoutRequest

 public static function createCheckoutRequest(Credentials $credentials, PaymentRequest $paymentRequest)
 {
     LogPagSeguro::info("PaymentService.Register(" . $paymentRequest->toString() . ") - begin");
     $connectionData = new PagSeguroConnectionData($credentials, self::serviceName);
     try {
         $connection = new HttpConnection();
         $connection->post(self::buildCheckoutRequestUrl($connectionData), PaymentParser::getData($paymentRequest), $connectionData->getServiceTimeout(), $connectionData->getCharset());
         $httpStatus = new HttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 $PaymentParserData = PaymentParser::readSuccessXml($connection->getResponse());
                 $paymentUrl = self::buildCheckoutUrl($connectionData, $PaymentParserData->getCode());
                 LogPagSeguro::info("PaymentService.Register(" . $paymentRequest->toString() . ") - end {1}" . $PaymentParserData->getCode());
                 break;
             case 'BAD_REQUEST':
                 $errors = PaymentParser::readErrors($connection->getResponse());
                 $e = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::error("PaymentService.Register(" . $paymentRequest->toString() . ") - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
             default:
                 $e = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::error("PaymentService.Register(" . $paymentRequest->toString() . ") - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
         }
         return isset($paymentUrl) ? $paymentUrl : false;
     } catch (PagSeguroServiceException $e) {
         throw $e;
     } catch (Exception $e) {
         LogPagSeguro::error("Exception: " . $e->getMessage());
         throw $e;
     }
 }
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:34,代码来源:PaymentService.class.php

示例6: getInstallments

 public static function getInstallments($credentials, $session, $amount, $cardBrand)
 {
     $connectionData = new PagSeguroConnectionData($credentials, 'installmentService');
     $url = self::buildInstallmentURL($connectionData) . "?sessionId=" . $session . "&amount=" . $amount . "&creditCardBrand=" . $cardBrand;
     LogPagSeguro::info("PagSeguroInstallmentService.getInstallments(" . $amount . "," . $cardBrand . ") - begin");
     try {
         $connection = new PagSeguroHttpConnection();
         $connection->get($url, $connectionData->getServiceTimeout(), $connectionData->getCharset());
         $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 $installments = PagSeguroInstallmentParser::readInstallments($connection->getResponse());
                 if (is_array($installments)) {
                     LogPagSeguro::info("PagSeguroInstallmentService.getInstallments() - end {1}");
                 } else {
                     LogPagSeguro::info("PagSeguroInstallmentService.getInstallments() - error" . $installments->message);
                     throw new Exception($installments->message);
                 }
                 break;
             case 'BAD_REQUEST':
                 $errors = PagSeguroInstallmentParser::readErrors($connection->getResponse());
                 $e = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::error("PagSeguroInstallmentService.getInstallments() - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
             default:
                 $e = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::error("PagSeguroInstallmentService.getInstallments() - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
         }
         return isset($installments) ? $installments : false;
     } catch (PagSeguroServiceException $e) {
         throw $e;
     } catch (Exception $e) {
         LogPagSeguro::error("Exception: " . $e->getMessage());
         throw $e;
     }
 }
开发者ID:esilvajr,项目名称:magento,代码行数:39,代码来源:PagSeguroInstallmentService.class.php

示例7: getResult

 /**
  * @param $connection
  * @return null|PagSeguroParserData
  * @throws PagSeguroServiceException
  */
 private function getResult($connection)
 {
     $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
     switch ($httpStatus->getType()) {
         case 'OK':
             $cancel = PagSeguroCancelParser::readSuccessXml($connection->getResponse());
             LogPagSeguro::info("PagSeguroCancelService.createRequest(" . $cancel . ") - end ");
             break;
         case 'BAD_REQUEST':
             $errors = PagSeguroCancelParser::readErrors($connection->getResponse());
             $err = new PagSeguroServiceException($httpStatus, $errors);
             LogPagSeguro::error("PagSeguroCancelService.createRequest() - error " . $err->getOneLineMessage());
             throw $err;
             break;
         default:
             $err = new PagSeguroServiceException($httpStatus);
             LogPagSeguro::error("PagSeguroCancelService.createRequest() - error " . $err->getOneLineMessage());
             throw $err;
             break;
     }
     return isset($cancel) ? $cancel : false;
 }
开发者ID:songinfo,项目名称:php,代码行数:27,代码来源:PagSeguroCancelService.class.php

示例8: searchAbandoned

 /**
  * Search transactions abandoned associated with this set of credentials within a date range
  *
  * @param PagSeguroCredentials $credentials
  * @param String $initialDate
  * @param String $finalDate
  * @param integer $pageNumber
  * @param integer $maxPageResults
  * @return PagSeguroTransactionSearchResult a object of PagSeguroTransactionSearchResult class
  * @see PagSeguroTransactionSearchResult
  * @throws PagSeguroServiceException
  * @throws Exception
  */
 public static function searchAbandoned(PagSeguroCredentials $credentials, $pageNumber, $maxPageResults, $initialDate, $finalDate = null)
 {
     LogPagSeguro::info("PagSeguroTransactionSearchService.searchAbandoned(initialDate=" . PagSeguroHelper::formatDate($initialDate) . ", finalDate=" . PagSeguroHelper::formatDate($finalDate) . ") - begin");
     $connectionData = new PagSeguroConnectionData($credentials, self::SERVICE_NAME);
     $searchParams = array('initialDate' => PagSeguroHelper::formatDate($initialDate), 'pageNumber' => $pageNumber, 'maxPageResults' => $maxPageResults);
     $searchParams['finalDate'] = $finalDate ? PagSeguroHelper::formatDate($finalDate) : null;
     try {
         $connection = new PagSeguroHttpConnection();
         $connection->get(self::buildSearchUrlAbandoned($connectionData, $searchParams), $connectionData->getServiceTimeout(), $connectionData->getCharset());
         $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 $searchResult = PagSeguroTransactionParser::readSearchResult($connection->getResponse());
                 LogPagSeguro::info("PagSeguroTransactionSearchService.searchAbandoned(initialDate=" . PagSeguroHelper::formatDate($initialDate) . ", finalDate=" . PagSeguroHelper::formatDate($finalDate) . ") - end " . $searchResult->toString());
                 break;
             case 'BAD_REQUEST':
                 $errors = PagSeguroTransactionParser::readErrors($connection->getResponse());
                 $e = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::error("PagSeguroTransactionSearchService.searchAbandoned(initialDate=" . PagSeguroHelper::formatDate($initialDate) . ", finalDate=" . PagSeguroHelper::formatDate($finalDate) . ") - end " . $e->getOneLineMessage());
                 throw $e;
                 break;
             default:
                 $e = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::error("PagSeguroTransactionSearchService.searchAbandoned(initialDate=" . PagSeguroHelper::formatDate($initialDate) . ", finalDate=" . PagSeguroHelper::formatDate($finalDate) . ") - end " . $e->getOneLineMessage());
                 throw $e;
                 break;
         }
         return isset($searchResult) ? $searchResult : false;
     } catch (PagSeguroServiceException $e) {
         throw $e;
     } catch (Exception $e) {
         LogPagSeguro::error("Exception: " . $e->getMessage());
         throw $e;
     }
 }
开发者ID:cbsistem,项目名称:PWD-Lib,代码行数:48,代码来源:PagSeguroTransactionSearchService.class.php

示例9: searchAuthorizationsReturn

 /**
  * @param PagSeguroHttpConnection $connection
  * @return bool|mixed|string
  * @throws PagSeguroServiceException
  */
 private function searchAuthorizationsReturn($connection)
 {
     $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
     switch ($httpStatus->getType()) {
         case 'OK':
             $authorization = PagSeguroAuthorizationParser::readSearchResult($connection->getResponse());
             LogPagSeguro::info("PagSeguroAuthorizationSearchService.searchAuthorizations() - end " . $authorization->toString());
             break;
         case 'BAD_REQUEST':
             $errors = PagSeguroAuthorizationParser::readErrors($connection->getResponse());
             $err = new PagSeguroServiceException($httpStatus, $errors);
             LogPagSeguro::error("PagSeguroAuthorizationSearchService.searchAuthorizations() - error " . $err->getOneLineMessage());
             throw $err;
             break;
         default:
             $err = new PagSeguroServiceException($httpStatus);
             LogPagSeguro::error("PagSeguroAuthorizationSearchService.searchAuthorizations() - error " . $err->getOneLineMessage());
             throw $err;
             break;
     }
     return isset($authorization) ? $authorization : false;
 }
开发者ID:esilvajr,项目名称:magento,代码行数:27,代码来源:PagSeguroAuthorizationSearchService.class.php

示例10: getResult

 /**
  * @param $connection
  * @param null $code
  * @return null|PagSeguroParserData
  * @throws PagSeguroServiceException
  */
 private function getResult($connection, $code = null)
 {
     $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
     $response = $connection->getResponse();
     switch ($httpStatus->getType()) {
         case 'OK':
             switch (self::$service) {
                 case "FindByCode":
                     $result = PagSeguroPreApprovalParser::readPreApproval($response);
                     break;
                 case "FindByNotification":
                     $result = PagSeguroPreApprovalParser::readPreApproval($response);
                     break;
                 case "FindByDayInterval":
                     $result = PagSeguroPreApprovalParser::readSearchResult($response);
                     break;
                 case "FindByDateInterval":
                     $result = PagSeguroPreApprovalParser::readSearchResult($response);
                     break;
                 case "FindByReference":
                     $result = PagSeguroPreApprovalParser::readSearchResult($response);
                     break;
             }
             //Logging
             if (is_null($code) && self::$service == "PreApprovalRequest") {
                 $log['text'] = sprintf("PagSeguroPreApprovalService.%s(" . $response->toString() . ") - end ", self::$service);
                 LogPagSeguro::info($log['text'] . ")");
             } else {
                 $log['text'] = sprintf("PagSeguroPreApprovalService.%s({$code}) - end ", self::$service);
                 LogPagSeguro::info($log['text']);
             }
             break;
         case 'BAD_REQUEST':
             $errors = PagSeguroServiceParser::readErrors($response);
             $errors = new PagSeguroServiceException($httpStatus, $errors);
             //Logging
             $log['text'] = sprintf("PagSeguroPreApprovalService.%s({$code}) - error ", self::$service);
             LogPagSeguro::error($log['text'] . $errors->getOneLineMessage());
             //Exception
             throw $errors;
             break;
         default:
             $errors = new PagSeguroServiceException($httpStatus);
             //Logging
             $log['text'] = sprintf("PagSeguroPreApprovalService.%s({$code}) - error ", self::$service);
             LogPagSeguro::error($log['text'] . $errors->getOneLineMessage());
             //Exception
             throw $errors;
             break;
     }
     return isset($result) ? $result : null;
 }
开发者ID:songinfo,项目名称:php,代码行数:58,代码来源:PagSeguroPreApprovalSearchService.class.php

示例11: cancelPreApproval

 public static function cancelPreApproval(PagSeguroCredentials $credentials, $notificationCode)
 {
     LogPagSeguro::info("PagSeguroNotificationService.cancelPreApproval(notificationCode={$notificationCode}) - begin");
     $connectionData = new PagSeguroConnectionData($credentials, self::SERVICE_NAME);
     try {
         $connection = new PagSeguroHttpConnection();
         $connection->get(self::buildCancelUrl($connectionData, $notificationCode), $connectionData->getServiceTimeout(), $connectionData->getCharset());
         $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
         switch ($httpStatus->getType()) {
             case 'OK':
                 $paymentParserData = PagSeguroPreApprovalParser::readCancelXml($connection->getResponse());
                 LogPagSeguro::info("PagSeguroPreApprovalService.cancelPreApproval({$parserData}) - end \\{{$notificationCode}\\}");
                 break;
             case 'BAD_REQUEST':
                 $errors = PagSeguroPreApprovalParser::readErrors($connection->getResponse());
                 $e = new PagSeguroServiceException($httpStatus, $errors);
                 LogPagSeguro::error("PagSeguroPreApprovalService.cancelPreApproval(notificationCode={$notificationCode}) - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
             default:
                 $e = new PagSeguroServiceException($httpStatus);
                 LogPagSeguro::error("PagSeguroPreApprovalService.cancelPreApproval(notificationCode={$notificationCode}) - error " . $e->getOneLineMessage());
                 throw $e;
                 break;
         }
         return isset($paymentParserData) ? $paymentParserData : false;
     } catch (PagSeguroServiceException $err) {
         LogPagSeguro::error("PagSeguroServiceException: " . $err->getMessage());
         throw $err;
     } catch (Exception $err) {
         LogPagSeguro::error("Exception: " . $err->getMessage());
         throw $err;
     }
 }
开发者ID:novasdream,项目名称:php,代码行数:34,代码来源:PagSeguroPreApprovalService.class.php

示例12: getResult

 /**
  * @param $connection
  * @param PagSeguroDirectPaymentRequest $request
  * @return null|PagSeguroParserData
  * @throws PagSeguroServiceException
  */
 private static function getResult($connection, PagSeguroDirectPaymentRequest $request)
 {
     $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
     switch ($httpStatus->getType()) {
         case 'OK':
             $paymentReturn = PagSeguroTransactionParser::readTransaction($connection->getResponse());
             LogPagSeguro::info("PagSeguroDirectPaymentService.Register(" . $request->toString() . ") - end {1}" . $paymentReturn->getCode());
             break;
         case 'BAD_REQUEST':
             $errors = PagSeguroTransactionParser::readErrors($connection->getResponse());
             $error = new PagSeguroServiceException($httpStatus, $errors);
             LogPagSeguro::error("PagSeguroDirectPaymentService.Register(" . $request->toString() . ") - error " . $error->getOneLineMessage());
             throw $error;
             break;
         default:
             $error = new PagSeguroServiceException($httpStatus);
             LogPagSeguro::error("PagSeguroDirectPaymentService.Register(" . $request->toString() . ") - error " . $error->getOneLineMessage());
             throw $error;
             break;
     }
     return isset($paymentReturn) ? $paymentReturn : false;
 }
开发者ID:songinfo,项目名称:php,代码行数:28,代码来源:PagSeguroDirectPaymentService.class.php

示例13: createLog

 private function createLog()
 {
     /*** Retrieving configurated default charset */
     PagSeguroConfig::setApplicationCharset(Configuration::get('PAGSEGURO_CHARSET'));
     /*** Retrieving configurated default log info */
     if (Configuration::get('PAGSEGURO_LOG_ACTIVE')) {
         PagSeguroConfig::activeLog(_PS_ROOT_DIR_ . Configuration::get('PAGSEGURO_LOG_FILELOCATION'));
     }
     LogPagSeguro::info("PagSeguroAbandoned.Search( 'Pesquisa de transações abandonadas realizada em " . date("d/m/Y H:i") . ".')");
 }
开发者ID:franklindias,项目名称:prestashop,代码行数:10,代码来源:PagSeguroAbandonedOrder.php

示例14: getResult

 /**
  * @param PagSeguroConnectionData $connection
  * @param $code
  * @return null|PagSeguroAuthorization|PagSeguroParserData|PagSeguroTransaction
  * @throws PagSeguroServiceException
  */
 private static function getResult($connection, $code)
 {
     $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
     $response = $connection->getResponse();
     switch ($httpStatus->getType()) {
         case 'OK':
             switch (self::$service) {
                 case "CheckPreApproval":
                     $response = PagSeguroPreApprovalParser::readPreApproval($response);
                     break;
                 case "CheckAuthorization":
                     $response = PagSeguroAuthorizationParser::readAuthorization($response);
                     break;
                 case "CheckTransaction":
                     $response = PagSeguroTransactionParser::readTransaction($response);
                     break;
             }
             //Logging
             $log['text'] = sprintf("PagSeguroNotificationService.%s(notificationCode={$code}) - end ", self::$service);
             $log['action'] = $response->toString();
             LogPagSeguro::info($log['text'] . $log['action'] . ")");
             break;
         case 'BAD_REQUEST':
             $errors = PagSeguroServiceParser::readErrors($connection->getResponse());
             $errors = new PagSeguroServiceException($httpStatus, $errors);
             //Logging
             $log['text'] = sprintf("PagSeguroNotificationService.%s(notificationCode={$code}) - error ", self::$service);
             LogPagSeguro::error($log['text'] . $errors->getOneLineMessage());
             //Exception
             throw $errors;
             break;
         default:
             $errors = new PagSeguroServiceException($httpStatus);
             //Logging
             $log['text'] = sprintf("PagSeguroNotificationService.%s(notificationCode={$code}) - error ", self::$service);
             LogPagSeguro::info($log['text'] . $errors->getOneLineMessage());
             //Exception
             throw $errors;
             break;
     }
     return isset($response) ? $response : null;
 }
开发者ID:songinfo,项目名称:php,代码行数:48,代码来源:PagSeguroNotificationService.class.php

示例15: getResult

 /**
  * @param $connection
  * @param null $code
  * @return null|PagSeguroParserData
  * @throws PagSeguroServiceException
  */
 private function getResult($connection, $code = null)
 {
     $httpStatus = new PagSeguroHttpStatus($connection->getStatus());
     $response = $connection->getResponse();
     switch ($httpStatus->getType()) {
         case 'OK':
             switch (self::$service) {
                 case "PreApprovalRequest":
                     $response = PagSeguroPreApprovalParser::readSuccessXml($response);
                     $result = array('code' => $response->getCode(), 'cancelUrl' => self::buildPreApprovalCancelUrl(self::$connectionData, $response->getCode()), 'checkoutUrl' => self::buildPreApprovalRequestUrl(self::$connectionData, $response->getCode()));
                     break;
                 case "PreApprovalCancel":
                     $result = PagSeguroPreApprovalParser::readCancelXml($response);
                     break;
                 case "PreApprovalPaymentCharge":
                     $result = PagSeguroPreApprovalParser::readTransactionXml($response);
                     break;
             }
             //Logging
             if (is_null($code) && self::$service == "PreApprovalRequest") {
                 $log['text'] = sprintf("PagSeguroPreApprovalService.%s(" . $response->toString() . ") - end ", self::$service);
                 LogPagSeguro::info($log['text'] . ")");
             } else {
                 $log['text'] = sprintf("PagSeguroPreApprovalService.%s({$code}) - end ", self::$service);
                 LogPagSeguro::info($log['text']);
             }
             break;
         case 'BAD_REQUEST':
             $errors = PagSeguroServiceParser::readErrors($response);
             $errors = new PagSeguroServiceException($httpStatus, $errors);
             //Logging
             $log['text'] = sprintf("PagSeguroPreApprovalService.%s({$code}) - error ", self::$service);
             LogPagSeguro::error($log['text'] . $errors->getOneLineMessage());
             //Exception
             throw $errors;
             break;
         default:
             $errors = new PagSeguroServiceException($httpStatus);
             //Logging
             $log['text'] = sprintf("PagSeguroPreApprovalService.%s({$code}) - error ", self::$service);
             LogPagSeguro::error($log['text'] . $errors->getOneLineMessage());
             //Exception
             throw $errors;
             break;
     }
     return isset($result) ? $result : null;
 }
开发者ID:songinfo,项目名称:php,代码行数:53,代码来源:PagSeguroPreApprovalService.class.php


注:本文中的LogPagSeguro::info方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。