T - the type of the view.public static interface PaymentFormView.Listener<T extends android.view.View & PaymentFormView> extends LoadingViewListener<T>, ExpiringViewListener<T>
The form may expire as such it extends ExpiringViewListener. The implementor may
want to reload the form in this situation.
The method invocation of the listener may or may not occur in the main loop. As such the implementor may want to delegate changes on the views triggered by this listener into the main loop.
| Modifier and Type | Method and Description |
|---|---|
void |
onAwaitingFinalState(T currentView)
This method is invoked when the user has completed the payment process but the
transaction has neither a
onSuccess(View) nor onFailure(View) state
reached. |
void |
onEnlargeView(T currentView)
This method is called when the view should be enlarged.
|
void |
onFailure(T currentView)
This method is invoked when the transaction has failed.
|
void |
onHttpError(T view,
HttpError error)
This method is invoked when there occurred a HTTP loading during the loading of the
WebView. |
void |
onResetView(T currentView)
This method is called when the enlarged screen is not required anymore.
|
void |
onSuccess(T currentView)
This method is invoked when the transaction has been completed successfully.
|
void |
onValidationFailure(T currentView,
java.util.List<java.lang.String> errors)
This method is invoked when the the invocation of
PaymentFormView.validate() failed. |
void |
onValidationSuccess(T currentView)
This method is invoked when the invocation of
PaymentFormView.validate() was successful. |
onLoading, onReadyonExpiredvoid onHttpError(T view, HttpError error)
WebView.view - the view which is responsible for the error.error - the error object which gives more details about the error.void onEnlargeView(T currentView)
The implementor has to make sure that the adjustment is done right away. It is also no
option to load the URL assigned to the currentView in a new WebView. The process
has to continue within the currentView.
currentView - the view object which requests the adjustment.void onResetView(T currentView)
onSuccess(View), onFailure(View) or onAwaitingFinalState(View).currentView - the view object which holds the form.void onValidationSuccess(T currentView)
PaymentFormView.validate() was successful.
The implementor may us this event to PaymentFormView.submit() the form. The submission be
also postponed and the user can be ask to execute further tasks before submitting the
form.
currentView - the current view object which was successfully validated.void onValidationFailure(T currentView, java.util.List<java.lang.String> errors)
PaymentFormView.validate() failed.
The implementor may want to give the user the chance to adjust the input. The errors may contain additional messages which can be shown to the user.
currentView - the current view which failed to validate successfully.errors - the list of errors which may give additional information to the user
about the validation failure.void onSuccess(T currentView)
The invocation of this method is no guarantee that the transaction is really successful. The user may have tampered it. As such this event should be only used to adjust the UI but not to change the merchant backend database. This update should occur through a webhook sent through the wallee platform. Further this method is invoked when at least the authorization was successful. This does not mean that the money is already transferred. For example with bank transfer this can take several days.
The implementor may want to remove the view and show some success message.
currentView - the view which has been completed successfully.void onFailure(T currentView)
The transaction fail because of different reasons. The user was not able to complete
the payment or the transaction was refused by the processor etc. The Transaction.getUserFailureMessage() may provide more details for the user about the
failure reason.
currentView - the view which contains the form with the failed transaction.void onAwaitingFinalState(T currentView)
onSuccess(View) nor onFailure(View) state
reached.
This can happen when the payment processor requires some time to find out what is going on with the transaction. This delays can take up several minutes. However if we end up here normally reaching a final result will take a few seconds.
The implementor may present some screen to the user which explains the situation and ask for patient. Additionally the implementor should implement a pooling strategy by which the web service API is asked for the latest transaction object. This object can be used to determine if the transaction has reached a final state. It is recommended to increase the interval over time.
currentView - the view which was not able to complete immediately.