public final class VolleyWebServiceApiClient extends java.lang.Object implements WebServiceApiClient
The request manager is implemented in an asynchronous way. This implies to call the remote service a callback as to be provided which is invoked once the request has completed.
The request manager uses the CredentialsProvider to fetch the Credentials to access the web service.
The request manager is not responsible to cache the returned result.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_BASE_URL
The default URL to which the requests will be sent to.
|
| Constructor and Description |
|---|
VolleyWebServiceApiClient(RequestQueue requestQueue,
CredentialsProvider credentialsProvider)
Constructs a new request manager.
|
VolleyWebServiceApiClient(RequestQueue requestQueue,
CredentialsProvider credentialsProvider,
java.lang.String baseUrl)
Constructs a new request manager.
|
| Modifier and Type | Method and Description |
|---|---|
void |
buildMobileSdkUrl(RequestCallback<MobileSdkUrl> callback)
This method constructs the URL which can be used to render the payment form within a
WebView. |
void |
fetchPaymentMethodConfigurations(RequestCallback<java.util.List<PaymentMethodConfiguration>> callback)
This method fetches the possible payment methods from the remote server.
|
void |
fetchTokenVersions(RequestCallback<java.util.List<TokenVersion>> callback)
This method fetches the
TokenVersion which may be used by the app user. |
void |
processOneClickToken(Token token,
RequestCallback<Transaction> callback)
This method processes the transaction with the given
token. |
void |
readTransaction(RequestCallback<Transaction> callback)
This method fetches the transaction object.
|
public static final java.lang.String DEFAULT_BASE_URL
public VolleyWebServiceApiClient(RequestQueue requestQueue,
CredentialsProvider credentialsProvider)
DEFAULT_BASE_URL
URL.requestQueue - the request queue which should be used. The request queue pools
the requests which the request manager sends to the remote server.
The request queue may be shared with the rest of the app.credentialsProvider - the credential provider which should be used. The credential
provider gives access to the credentials which the request manager
requires to access the remote server.public VolleyWebServiceApiClient(RequestQueue requestQueue,
CredentialsProvider credentialsProvider,
java.lang.String baseUrl)
requestQueue - the request queue which should be used. The request queue pools
the requests which the request manager sends to the remote server.
The request queue may be shared with the rest of the app.credentialsProvider - the credential provider which should be used. The credential
provider gives access to the credentials which the request manager
requires to access the remote server.baseUrl - the base URL to which the requests should be sent to. This may
differ when using another environment. This is mainly here for
testing purposes.public void fetchTokenVersions(RequestCallback<java.util.List<TokenVersion>> callback)
WebServiceApiClientTokenVersion which may be used by the app user. The returned
tokens are intended to be uses as one-click tokens. The method will only return valid tokens.fetchTokenVersions in interface WebServiceApiClientcallback - the callback which is invoked once the token versions have been loaded.public void buildMobileSdkUrl(RequestCallback<MobileSdkUrl> callback)
WebServiceApiClientWebView. The URL is used for example in DefaultPaymentFormView.buildMobileSdkUrl in interface WebServiceApiClientcallback - the callback which is invoked once the URL has been loaded.public void fetchPaymentMethodConfigurations(RequestCallback<java.util.List<PaymentMethodConfiguration>> callback)
WebServiceApiClientCredentials. As such the method
may return less payment methods as configured in the wallee backend.
The payment method configuration is linked with an icon. This icon can be loaded by IconRequestManager.fetchIcon(PaymentMethodConfiguration, RequestCallback).
fetchPaymentMethodConfigurations in interface WebServiceApiClientcallback - the callback which is invoked once all the payment methods has been loaded.public void readTransaction(RequestCallback<Transaction> callback)
WebServiceApiClientreadTransaction in interface WebServiceApiClientcallback - the callback which is invoked once the transaction has been loaded.public void processOneClickToken(Token token, RequestCallback<Transaction> callback)
WebServiceApiClienttoken. Processing means the
remote server is invoked to authorize the transaction.processOneClickToken in interface WebServiceApiClienttoken - the token which should be used to process the transaction.callback - the callback which is invoked once the remote server gives a response.