private static function buildSearchUrlAbandoned(PagSeguroConnectionData $connectionData, array $searchParams)
 {
     $url = $connectionData->getServiceUrl();
     $initialDate = $searchParams['initialDate'] != null ? $searchParams['initialDate'] : "";
     $finalDate = $searchParams['finalDate'] != null ? "&finalDate=" . $searchParams['finalDate'] : "";
     if ($searchParams['pageNumber'] != null) {
         $page = "&page=" . $searchParams['pageNumber'];
     }
     if ($searchParams['maxPageResults'] != null) {
         $maxPageResults = "&maxPageResults=" . $searchParams['maxPageResults'];
     }
     return "{$url}/abandoned/?" . $connectionData->getCredentialsUrlQuery() . "&initialDate={$initialDate}&finalDate={$finalDate}{$page}{$maxPageResults}";
 }
 private static function buildTransactionNotificationUrl(PagSeguroConnectionData $connectionData, $notificationCode)
 {
     $url = $connectionData->getServiceUrl();
     return "{$url}/{$notificationCode}/?" . $connectionData->getCredentialsUrlQuery();
 }
 private static function buildCheckoutRequestUrl(PagSeguroConnectionData $connectionData)
 {
     return $connectionData->getServiceUrl() . '/?' . $connectionData->getCredentialsUrlQuery();
 }
 private static function buildReturnUrl(PagSeguroConnectionData $connectionData, $code)
 {
     return $connectionData->getServiceUrl() . '/' . $code . '/?' . $connectionData->getCredentialsUrlQuery();
 }
 /**
  * @param PagSeguroConnectionData $connectionData
  * @param $reference
  * @return string
  */
 private static function buildSearchUrlByReference(PagSeguroConnectionData $connectionData, $reference)
 {
     $url = $connectionData->getServiceUrl();
     return "{$url}?" . $connectionData->getCredentialsUrlQuery() . '&reference=' . $reference;
 }
 private static function buildCheckoutRequestUrl(PagSeguroConnectionData $connectionData)
 {
     return $connectionData->getServiceUrl();
 }
 private static function buildAuthorizationUrl(PagSeguroConnectionData $connectionData)
 {
     return $connectionData->getServiceUrl() . $connectionData->getResource('requestUrl') . '?';
 }
 private static function buildPreApprovalUrl(PagSeguroConnectionData $connectionData)
 {
     return $connectionData->getServiceUrl();
 }
 /**
  * @param PagSeguroConnectionData $connectionData
  * @param $reference
  * @param null $searchParams
  * @return string
  */
 private static function buildSearchUrlByReference(PagSeguroConnectionData $connectionData, $reference, $searchParams = null)
 {
     $url = $connectionData->getServiceUrl('v2');
     if ($searchParams == null) {
         return "{$url}?" . $connectionData->getCredentialsUrlQuery() . "&reference=" . $reference;
     } else {
         $initialDate = $searchParams['initialDate'] != null ? $searchParams['initialDate'] : "";
         $finalDate = $searchParams['finalDate'] != null ? "&finalDate=" . $searchParams['finalDate'] : "";
         if ($searchParams['pageNumber'] != null) {
             $page = "&page=" . $searchParams['pageNumber'];
         }
         if ($searchParams['maxPageResults'] != null) {
             $maxPageResults = "&maxPageResults=" . $searchParams['maxPageResults'];
         }
         return "{$url}?" . $connectionData->getCredentialsUrlQuery() . "&reference=" . $reference . "&initialDate={$initialDate}&finalDate={$finalDate}{$page}{$maxPageResults}";
     }
 }