private static String buildURLByCode(Credentials credentials, String transactionCode) {
   return URL_SERVICE
       + "/"
       + transactionCode
       + "?"
       + UrlUtil.buildQueryString(credentials.getAttributes());
 }
  private static String buildURLByDateInterval(
      Credentials credentials,
      String serviceURL,
      Date initialDate,
      Date finalDate,
      Integer page,
      Integer maxPageResults) {

    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);

    StringBuffer url = new StringBuffer();
    url.append(serviceURL);
    url.append("?initialDate=" + (initialDate != null ? sdf.format(initialDate) : ""));
    url.append("&finalDate=" + (finalDate != null ? sdf.format(finalDate) : ""));
    if (page != null) {
      url.append("&page=" + page);
    }
    if (maxPageResults != null) {
      url.append("&maxPageResults=" + maxPageResults);
    }
    url.append("&" + UrlUtil.buildQueryString(credentials.getAttributes()));

    return url.toString();
  }
Beispiel #3
0
 private static String buildUrl(Credentials credentials, PaymentRequest payment) {
   return URL_SERVICE + "?" + UrlUtil.buildQueryString(credentials.getAttributes());
 }