com.payu.sdk.api.ApiEndpoints Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-client Show documentation
Show all versions of api-client Show documentation
A fresh implementation of the PayU API Client for Android
The newest version!
package com.payu.sdk.api;
import retrofit.Endpoint;
import retrofit.Endpoints;
public enum ApiEndpoints {
PAYMENTS_PRODUCTION("payments_production", "https://api.payulatam.com/payments-api"),
PAYMENTS_TESTING("payments_testing", "https://stg.api.payulatam.com/payments-api"),
REPORTS_PRODUCTION("reports_production", "https://api.payulatam.com/reports-api"),
REPORTS_TESTING("reports_testing", "https://stg.api.payulatam.com/reports-api"),
CUSTOM("custom", null);
public final String name;
public final String url;
ApiEndpoints(String name, String url) {
this.name = name;
this.url = url;
}
public static ApiEndpoints from(String endpoint) {
for (ApiEndpoints value : values()) {
if (value.url != null && value.url.equals(endpoint)) {
return value;
}
}
return CUSTOM;
}
public Endpoint endpoint() {
return Endpoints.newFixedEndpoint(this.url, this.name);
}
@Override public String toString() {
return name;
}
}