Skip to content

Commit

Permalink
Merge pull request #45 from culqi/feature/api-base-service-get
Browse files Browse the repository at this point in the history
format domain services get
  • Loading branch information
JoseHCalderon authored Oct 24, 2024
2 parents 53c066e + 9288d7d commit 6f1cf8e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/culqi/apioperation/ResponseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ public ResponseCulqi list(String url, String params) {
String result = "";

try {
HttpUrl.Builder builder = new HttpUrl.Builder();
HttpUrl.Builder builder = HttpUrl.parse(Config.API_BASE).newBuilder();

builder.scheme("https").host(Config.DOMAIN).addPathSegment("v2");
if (url.contains("plans")) {
builder.addPathSegment("recurrent").addPathSegment("plans");
} else if (url.contains("subscriptions")) {
builder.addPathSegment("recurrent").addPathSegment("subscriptions");
} else {
builder.scheme("https").host(Config.DOMAIN).addPathSegment("v2").addPathSegment(url);
String cleanUrl = url.replaceAll("^/+", "").replaceAll("/+$", "");
builder.addPathSegments(cleanUrl);
}

if (params != null) {
Expand Down

0 comments on commit 6f1cf8e

Please sign in to comment.