private static function buildInstallmentURL(PagSeguroConnectionData $connectionData, $amount, $cardBrand = null, $maxInstallmentNoInterest = null)
 {
     $url = $connectionData->getWebserviceUrl() . $connectionData->getResource('url');
     $stringBuilder = "&amount=" . $amount;
     $stringBuilder .= $cardBrand == null ? "" : "&cardBrand=" . $cardBrand;
     $stringBuilder .= $maxInstallmentNoInterest == null ? "" : "&maxInstallmentNoInterest=" . $maxInstallmentNoInterest;
     return "{$url}/?" . $connectionData->getCredentialsUrlQuery() . $stringBuilder;
 }
 /**
  * @param PagSeguroConnectionData $connectionData
  * @param array $params
  * @return string
  */
 private static function buildFindByReferenceUrl(PagSeguroConnectionData $connectionData, array $params)
 {
     $url = $connectionData->getWebserviceUrl() . $connectionData->getResource('findUrl');
     $initialDate = $params['initialDate'] != null ? $params['initialDate'] : "";
     $finalDate = $params['finalDate'] != null ? "&finalDate=" . $params['finalDate'] : "";
     $reference = $params['reference'] != null ? "&reference=" . $params['reference'] : "";
     if ($params['pageNumber'] != null) {
         $page = "&page=" . $params['pageNumber'];
     }
     if ($params['maxPageResults'] != null) {
         $maxPageResults = "&maxPageResults=" . $params['maxPageResults'];
     }
     return "{$url}?" . $connectionData->getCredentialsUrlQuery() . "&initialDate={$initialDate}{$finalDate}{$page}{$maxPageResults}{$reference}";
 }
 private static function buildTransactionNotificationUrl(PagSeguroConnectionData $connectionData, $notificationCode)
 {
     $url = $connectionData->getWebserviceUrl() . $connectionData->getResource('notifications');
     return "{$url}/{$notificationCode}/?" . $connectionData->getCredentialsUrlQuery();
 }
 private static function buildPreApprovalCancelUrl(PagSeguroConnectionData $connectionData, $code)
 {
     $credentialsArray = $connectionData->getCredentials()->getAttributesMap();
     return $connectionData->getWebserviceUrl() . $connectionData->getResource('cancelUrl') . "{$code}?" . $connectionData->getCredentialsUrlQuery();
 }
 private static function buildAuthorizationNotificationUrl(PagSeguroConnectionData $connectionData, $notificationCode)
 {
     $url = $connectionData->getWebserviceUrl() . '/' . $connectionData->getResource('applicationPath');
     return "{$url}/{$notificationCode}/?" . $connectionData->getCredentialsUrlQuery();
 }
 /**
  * @param PagSeguroConnectionData $connectionData
  * @param $preApprovalCode
  * @return string
  */
 private static function buildPreApprovalNotificationUrl(PagSeguroConnectionData $connectionData, $preApprovalCode)
 {
     $url = $connectionData->getWebserviceUrl() . '/' . $connectionData->getResource('preApprovalPath');
     return "{$url}/{$preApprovalCode}/?" . $connectionData->getCredentialsUrlQuery();
 }