com.global.api.entities.Request Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of globalpayments-sdk Show documentation
Show all versions of globalpayments-sdk Show documentation
API for processing payments through Global Payments
package com.global.api.entities;
import com.global.api.utils.StringUtils;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.util.HashMap;
import java.util.Map;
@Accessors(chain = true)
public class Request {
@Getter @Setter private HttpMethod verb = HttpMethod.Get;
@Getter @Setter private String endpoint;
@Getter @Setter private String RequestBody = "";
@Getter private HashMap queryStringParams;
@Getter @Setter
public Map maskedData = new HashMap<>();
public Request() {
queryStringParams = new HashMap<>();
}
public enum HttpMethod {
Get("GET"),
Post("POST"),
Patch("PATCH"),
Delete("DELETE"),
Put("PUT");
private final String value;
HttpMethod(String value) { this.value = value; }
public String getValue() {
return value;
}
}
public void addQueryStringParam(String name, String value) {
if (!StringUtils.isNullOrEmpty(name) && !StringUtils.isNullOrEmpty(value)) {
queryStringParams.put(name, value);
}
}
}