public static class FlowConfiguration.Builder
extends java.lang.Object
When there is no specific behaviour required the minimal(CredentialsProvider,
Context) method provides the simplest possible configuration which works out of the
box.
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
FlowConfiguration.Builder |
addListeners(java.util.Collection<FlowListener> listeners)
This method adds a listener to the configuration builder.
|
FlowConfiguration.Builder |
addListeners(FlowListener... listeners)
This method adds a listener to the configuration builder.
|
FlowConfiguration |
build()
This method builds the configuration based up on the properties set on the builder.
|
static FlowConfiguration.Builder |
minimal(CredentialsProvider credentialsProvider,
android.content.Context context)
This method provides a minimal configuration which works for most cases.
|
FlowConfiguration.Builder |
setAwaitingFinalStateViewFactory(AwaitingFinalStateViewFactory awaitingFinalStateViewFactory)
This method sets the factory which is responsible for creating the awaiting final state
view.
|
FlowConfiguration.Builder |
setFailureViewFactory(FailureViewFactory failureViewFactory)
This method sets the factory which is responsible for creating the failure view.
|
FlowConfiguration.Builder |
setIconCache(IconCache iconCache)
This method sets the cache which stores the downloaded images from the remote server.
|
FlowConfiguration.Builder |
setIconRequestManager(IconRequestManager iconRequestManager)
This method sets the icon request manager which should be used.
|
FlowConfiguration.Builder |
setListeners(java.util.Collection<? extends FlowListener> listeners)
This method sets a listener to the configuration builder.
|
FlowConfiguration.Builder |
setPaymentFormViewFactory(PaymentFormViewFactory paymentFormViewFactory)
This method defines the factory which creates the form for the payment information
collection.
|
FlowConfiguration.Builder |
setPaymentMethodListViewFactory(PaymentMethodListViewFactory paymentMethodListViewFactory)
This method sets the factory which is responsible for creating the payment method
selection screen.
|
FlowConfiguration.Builder |
setSuccessViewFactory(SuccessViewFactory successViewFactory)
This method sets the factory which is responsible for creating the success view.
|
FlowConfiguration.Builder |
setTokenListViewFactory(TokenListViewFactory tokenListViewFactory)
This method sets the token selection view.
|
FlowConfiguration.Builder |
setWebServiceApiClient(WebServiceApiClient webServiceApiClient)
This method sets the web service API client.
|
public static FlowConfiguration.Builder minimal(CredentialsProvider credentialsProvider, android.content.Context context)
The provided configuration will use an in-memory cache (see InMemoryIconCache
for the payment icons and it will use a default RequestQueue which is stored in a
static field (see VolleyRequestQueueHolder.
credentialsProvider - the credential provider which should be used.context - the context which should be used to construct the request
queue.public FlowConfiguration.Builder addListeners(FlowListener... listeners)
The listener can implement any number of sub interfaces of FlowListener. All
listener interfaces implemented by the provided listeners will be picked up.
listeners - the listeners which should be registered.public FlowConfiguration.Builder addListeners(java.util.Collection<FlowListener> listeners)
The listener can implement any number of sub interfaces of FlowListener. All
listener interfaces implemented by the provided listeners will be picked up.
listeners - the listeners which should be registered.public FlowConfiguration.Builder setListeners(java.util.Collection<? extends FlowListener> listeners)
The listener can implement any number of sub interfaces of FlowListener. All
listener interfaces implemented by the provided listeners will be picked up.
listeners - the listeners which should be registered.public FlowConfiguration.Builder setIconCache(IconCache iconCache)
The cache is required to improve the performance of the loading of the payment method selection screen and token selection screen. Depending on the app purpose the cache may be in-memory, transient or a file based.
iconCache - the cache which should be used for the downloaded icons.IconCachepublic FlowConfiguration.Builder setIconRequestManager(IconRequestManager iconRequestManager)
The icon request manager is responsible for downloading the icons from the remote server.
You may consider the VolleyIconRequestManager which is an implementation which
uses com.android.volley.toolbox.Volley.
iconRequestManager - the request manager for downloading the icons from the remote
server.IconRequestManagerpublic FlowConfiguration.Builder setWebServiceApiClient(WebServiceApiClient webServiceApiClient)
The web service API client is used to communicate with the wallee web service API. This includes the fetching of the payment methods etc.
You may consider the VolleyWebServiceApiClient which is an implementation
which uses internally com.android.volley.toolbox.Volley.
webServiceApiClient - the web service client to use for sending API requests to the
remote web service.public FlowConfiguration.Builder setPaymentFormViewFactory(PaymentFormViewFactory paymentFormViewFactory)
The payment form is a WebView which is responsible to collect
all payment details.
paymentFormViewFactory - the factory which should be used.PaymentFormViewFactory,
DefaultPaymentFormViewFactorypublic FlowConfiguration.Builder setTokenListViewFactory(TokenListViewFactory tokenListViewFactory)
tokenListViewFactory - the factory which should be used to create the token selection
screen.TokenListViewFactory,
DefaultTokenListViewFactorypublic FlowConfiguration.Builder setPaymentMethodListViewFactory(PaymentMethodListViewFactory paymentMethodListViewFactory)
paymentMethodListViewFactory - the factory which should be used to create the payment
method selection view.PaymentMethodListViewFactory,
DefaultPaymentMethodListViewFactorypublic FlowConfiguration.Builder setSuccessViewFactory(SuccessViewFactory successViewFactory)
When the transaction is successful the coordinator shows a view with a success message. This method controls which factory is used to create this view.
successViewFactory - the factory which should be used to create the success view.SuccessViewFactory,
DefaultSuccessViewFactorypublic FlowConfiguration.Builder setFailureViewFactory(FailureViewFactory failureViewFactory)
When the transaction fails the coordinator shows a view with a failure message. This method controls which factory is used to create this view.
failureViewFactory - the factory which should be used to create the failure view.FailureViewFactory,
DefaultFailureViewFactorypublic FlowConfiguration.Builder setAwaitingFinalStateViewFactory(AwaitingFinalStateViewFactory awaitingFinalStateViewFactory)
When the transaction is processed by the coordinator it can happen that the transaction is not immediately in a final state. This factory is responsible to create the view which is shown in this situation.
awaitingFinalStateViewFactory - the factory which should be used to create the
awaiting final state view.AwaitingFinalStateViewFactory,
DefaultAwaitingFinalStateViewFactorypublic FlowConfiguration build()