Пример #1
0
 /**
  * Request abandoned PagSeguroTransactions
  * @param DateTime $initialDate
  * @param string $page
  * @param string $resultsInPage
  * @return PagSeguroTransactionSearchResult
  */
 public function abandonedRequest($initialDate, $page = null, $resultsInPage = null)
 {
     if (is_null($page)) {
         $page = 1;
     }
     if (is_null($resultsInPage)) {
         $resultsInPage = 1000;
     }
     return $this->searchService->searchAbandoned($this->credentials, $page, $resultsInPage, $initialDate);
 }
 /**
  * Inicia a consulta por transações abandonadas em um período de 1 mês
  * 
  * @param string $dataInicial (YYYY-mm-dd)
  * @param string $dataFinal (YYYY-mm-dd)
  * @param int $pagina
  * @param int $quantidadeMaximaRegistros
  * @return boolean
  * @since 1.4
  */
 public function obterTransacoesAbandonadas($dataFinal, $pagina = 1, $quantidadeMaximaRegistros = 30)
 {
     $dataInicial = date('Y-m-d', strtotime($dataFinal . '-1month '));
     $dataInicial .= 'T00:01';
     $dataFinal .= 'T23:59';
     try {
         if ($result = $this->transacoes = PagSeguroTransactionSearchService::searchAbandoned($this->credenciais, $pagina, $quantidadeMaximaRegistros, $dataInicial, $dataFinal)) {
             return $this->montarDetalhesTransacoesAbandonadas($result);
         }
     } catch (PagSeguroServiceException $e) {
         echo $e->getMessage();
         exit;
     }
 }
 public static function main()
 {
     $initialDate = '2014-03-10T08:50';
     $finalDate = '2014-03-29T10:30';
     $pageNumber = 1;
     $maxPageResults = 20;
     try {
         /*
          * #### Credentials #####
          * Substitute the parameters below with your credentials (e-mail and token)
          * You can also get your credentials from a config file. See an example:
          * $credentials = PagSeguroConfig::getAccountCredentials();
          */
         $credentials = new PagSeguroAccountCredentials("*****@*****.**", "E231B2C9BCC8474DA2E260B6C8CF60D3");
         $result = PagSeguroTransactionSearchService::searchAbandoned($credentials, $pageNumber, $maxPageResults, $initialDate, $finalDate);
         self::printResult($result, $initialDate, $finalDate);
     } catch (PagSeguroServiceException $e) {
         die($e->getMessage());
     }
 }
 public static function main()
 {
     $initialDate = '2011-12-10T08:50';
     $finalDate = '2011-12-29T10:30';
     $pageNumber = 1;
     $maxPageResults = 20;
     try {
         /*
          * #### Crendencials #####
          * Substitute the parameters below with your credentials (e-mail and token)
          * You can also get your credentails from a config file. See an example:
          * $credentials = PagSeguroConfig::getAccountCredentials();
          */
         $credentials = new PagSeguroAccountCredentials("*****@*****.**", "your_token_here");
         $result = PagSeguroTransactionSearchService::searchAbandoned($credentials, $pageNumber, $maxPageResults, $initialDate, $finalDate);
         self::printResult($result, $initialDate, $finalDate);
     } catch (PagSeguroServiceException $e) {
         die($e->getMessage());
     }
 }
 public static function main()
 {
     $initialDate = '2014-11-01T14:55';
     $finalDate = '2014-11-30T09:55';
     $pageNumber = 1;
     $maxPageResults = 20;
     try {
         /*
          * #### Credentials #####
          * Substitute the parameters below with your credentials
          * You can also get your credentials from a config file. See an example:
          * $credentials = PagSeguroConfig::getAccountCredentials();
          */
         // seller authentication
         $credentials = new PagSeguroAccountCredentials("*****@*****.**", "E231B2C9BCC8474DA2E260B6C8CF60D3");
         // application authentication
         //$credentials = PagSeguroConfig::getApplicationCredentials();
         //$credentials->setAuthorizationCode("E231B2C9BCC8474DA2E260B6C8CF60D3");
         $result = PagSeguroTransactionSearchService::searchAbandoned($credentials, $pageNumber, $maxPageResults, $initialDate, $finalDate);
         self::printResult($result, $initialDate, $finalDate);
     } catch (PagSeguroServiceException $e) {
         die($e->getMessage());
     }
 }
 private function getPagSeguroTransactions($recoveryDays)
 {
     if (!$this->createCredentials()) {
         return false;
     }
     $recoveryDays = (int) $recoveryDays;
     $now = date('Y-m-d H:i:s');
     list($year, $month, $day) = explode('-', $now);
     list($hour, $minutes, $seconds) = explode(':', $now);
     $hour = explode(" ", $hour);
     $initialDay = date(DATE_ATOM, mktime($hour[1], $minutes, $seconds, $month, $day - $recoveryDays, $year));
     try {
         $serviceData = PagSeguroTransactionSearchService::searchAbandoned($this->credentials, 1, 1000, $initialDay);
     } catch (PagSeguroServiceException $e) {
         array_push($this->messages, $e->getOneLineMessage());
     } catch (Exception $e) {
         array_push($this->messages, $e->getMessage());
     }
     return $serviceData ? $serviceData->getTransactions() : false;
 }
Пример #7
0
 private function getAbandoned()
 {
     $now = date('Y-m-d H:i:s');
     list($year, $month, $day) = explode('-', $now);
     list($hour, $minutes, $seconds) = explode(':', $now);
     $hour = explode(" ", $hour);
     $initialDay = date(DATE_ATOM, mktime($hour[1], $minutes, $seconds, $month, $day - Configuration::get('PAGSEGURO_DAYS_RECOVERY'), $year));
     return PagSeguroTransactionSearchService::searchAbandoned($this->objCredential, 1, 1000, $initialDay);
 }
Пример #8
0
 /**
  * Get list of abandoned PagSeguro
  * @return array $listAbandoned - Array with transactions
  */
 public function getPagSeguroAbandonedList()
 {
     if ($this->access == 1) {
         include_once Mage::getBaseDir('lib') . '/PagSeguroLibrary/PagSeguroLibrary.php';
         $obj = Mage::getSingleton('UOL_PagSeguro_Model_PaymentMethod');
         $this->dateStart = Mage::helper('pagseguro')->getDateSubtracted($this->days);
         try {
             $credential = $obj->getCredentialsInformation();
             $dateStart = $this->getDateStart();
             $listAbandoned = PagSeguroTransactionSearchService::searchAbandoned($credential, 1, 1000, $dateStart);
             return $listAbandoned->getTransactions();
         } catch (PagSeguroServiceException $e) {
             if (trim($e->getMessage()) == '[HTTP 401] - UNAUTHORIZED') {
                 throw new Exception($e->getMessage());
             }
         }
     }
 }