public class ApruveClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static ApruveClient |
client |
| Modifier | Constructor and Description |
|---|---|
protected |
ApruveClient(String apiKey,
ApruveEnvironment env) |
| Modifier and Type | Method and Description |
|---|---|
<T> ApruveResponse<T> |
delete(String path,
Class<T> responseType) |
<T> ApruveResponse<T> |
get(String path,
Class<T> resultType)
Issues a GET request against to the Apruve REST API, using the specified
path.
|
String |
getApiKey() |
ApruveEnvironment |
getEnvironment() |
static ApruveClient |
getInstance() |
<T> ApruveResponse<List<T>> |
index(String path,
javax.ws.rs.core.GenericType<List<T>> resultType)
As get(), but specialized to return lists of objects for REST index
operations
|
static void |
init(String apiKey,
ApruveEnvironment env)
Provides a single point of initialization for the ApruveClient library.
|
static void |
initToNull()
Intended for use in unit testing only.
|
<T,RT> ApruveResponse<RT> |
post(String path,
T payload,
Class<RT> responseType) |
<T,RT> ApruveResponse<RT> |
put(String path,
T payload,
Class<RT> responseType) |
protected javax.ws.rs.client.Invocation.Builder |
restRequest(String path) |
protected static ApruveClient client
protected ApruveClient(String apiKey, ApruveEnvironment env)
apiKey - env - public static ApruveClient getInstance()
public static void init(String apiKey, ApruveEnvironment env)
apiKey - An API Key from your user account. Create on for your test
account on https://test.apruve.com/merchants, or create one
for live transactions at https://www.apruve.com/merchants. We
recommend that you create a unique API Key for each merchant
account.env - com.apruve.ApruveClient.Environment.PROD or
com.apruve.ApruveClient.Environment.TEST, as appropriate.public String getApiKey()
public ApruveEnvironment getEnvironment()
public static void initToNull()
protected javax.ws.rs.client.Invocation.Builder restRequest(String path)
public <T> ApruveResponse<List<T>> index(String path, javax.ws.rs.core.GenericType<List<T>> resultType)
path - The path to issue the GET againstresultType - A GenericType instance that determines the type of
list returnedpublic <T> ApruveResponse<T> get(String path, Class<T> resultType)
path - The path to issue the GET againstresultType - The type of the responsepublic <T,RT> ApruveResponse<RT> post(String path, T payload, Class<RT> responseType)
public <T,RT> ApruveResponse<RT> put(String path, T payload, Class<RT> responseType)
public <T> ApruveResponse<T> delete(String path, Class<T> responseType)
Copyright © 2016. All rights reserved.