public static function main() { $reference = "REF123"; try { /** * #### Credentials ##### * Replace the parameters below with your credentials * You can also get your credentials from a config file. See an example: * $credentials = PagSeguroConfig::getApplicationCredentials(); */ $credentials = new PagSeguroApplicationCredentials("appId", "appKey"); $authorization = PagSeguroAuthorizationSearchService::searchByReference($credentials, $reference); self::printAuthorization($authorization); } catch (PagSeguroServiceException $e) { die($e->getMessage()); } }
public static function main() { $notificationCode = "B9BD516853A853A812422463EFBD10FCC88A"; try { /** * #### Credentials ##### * Replace the parameters below with your credentials * You can also get your credentials from a config file. See an example: * $credentials = PagSeguroConfig::getApplicationCredentials(); */ $credentials = new PagSeguroApplicationCredentials("appId", "appKey"); $authorization = PagSeguroAuthorizationSearchService::searchByNotificationCode($credentials, $notificationCode); self::printAuthorization($authorization); } catch (PagSeguroServiceException $e) { die($e->getMessage()); } }
public static function main() { $options = array('page' => 1, 'maxPageResults' => 1, 'initialDate' => '2014-11-23T00:00', 'finalDate' => '2014-12-02T10:00'); try { /* * #### Credentials ##### * Replace the parameters below with your credentials * You can also get your credentials from a config file. See an example: * $credentials = PagSeguroConfig::getApplicationCredentials() */ $credentials = new PagSeguroApplicationCredentials("appId", "appKey"); $authorization = PagSeguroAuthorizationSearchService::searchAuthorizations($credentials, $options); self::printAuthorization($authorization); } catch (PagSeguroServiceException $e) { die($e->getMessage()); } }
public static function main() { //$authorizationCode = "C7A067F4AEDC4B538242EBBE3B7FB755"; $authorizationCode = "FD3AF1B214EC40F0B0A6745D041BF50D"; try { /** * #### Credentials ##### * Replace the parameters below with your credentials * You can also get your credentials from a config file. See an example: * $credentials = PagSeguroConfig::getApplicationCredentials(); */ $credentials = new PagSeguroApplicationCredentials("appId", "appKey"); $credentials = PagSeguroConfig::getApplicationCredentials(); $authorization = PagSeguroAuthorizationSearchService::searchByCode($credentials, $authorizationCode); self::printAuthorization($authorization); } catch (PagSeguroServiceException $e) { die($e->getMessage()); } }
public static function searchByReference(PagSeguroCredentials $credentials, $reference) { LogPagSeguro::info("PagSeguroAuthorizationSearchService.SearchByReference({$reference}) - begin"); $connectionData = new PagSeguroConnectionData($credentials, self::SERVICE_NAME); try { $connection = new PagSeguroHttpConnection(); $connection->get(self::buildSearchUrlByReference($connectionData, $reference), $connectionData->getServiceTimeout(), $connectionData->getCharset()); self::$logService = "SearchByReference"; return self::searchAuthorizationsReturn($connection, $reference); } catch (PagSeguroServiceException $err) { throw $err; } catch (Exception $err) { LogPagSeguro::error("Exception: " . $err->getMessage()); throw $err; } }