This document describes transaction lifecycle as implemented in android/iOS libraries.
Invoked after transaction is started.
Transaction is started in two cases:
- Regular non 3ds transaction
- After submitting 3ds form
Library method signature:
- Android:
void showProgress();
- iOS:
-(void) showProgress;
Invoked after:
- Transaction fails
- Transaction is started but redirected to 3ds page
Library method signature:
- Android:
void hideProgress();
- iOS:
-(void) hideProgress;
Transaction success. Invoked after successful transaction or after checking transactions status within TransactionLifecycleAdapter#timeout
Only invoked if:
- transaction response is not null
- transaction is successful - response_code = 0000 and status = approved
Library method signature:
- Android:
void transactionSuccess(TransactionSuccess transactionSuccess);
- iOS:
-(void) transactionSuccess: (TransactionSuccess *) success;
Invoked if user press hardware back button while transaction is in progress.
Can be used to show additional info, alert dialog etc.
NOTE - android
:
Invoked if user press hardware back button while transaction is in progress.
Can be used to show additional info, alert dialog etc.
Requirements:
- override {@link Activity#onBackPressed()}
- invoke {@link WebtehWebView#isBackAllowed()}
- if navigation back is disabled {@link WebtehWebView#isBackAllowed()} will invoke {@link TransactionLifecycleDelegate#backPressedTransactionInProgress()}
Call is blocking!
Library method signature:
- Android:
void backPressedTransactionInProgress();
- iOS: Not implemented
Invoked after 3ds form is submitted
Library method signature:
- Android:
void threeDsLoaded();
- iOS:
-(void) threeDsSubmitted;
Invoked after 3ds form is loaded
Library method signature:
- Android:
void threeDsLoaded();
- iOS:
-(void) threeDsLoaded;
Provides centralized transaction error handling mechanism.
There are two error types:
- application [api + library] errors
- business error [payment gateway defined errors]
To compare errors do following:
- check if error is application error
ApiError#isApplicationError
- compare
ApiError#code
with already defined errors which can be found in:
ApiErrors
>= v1.5.0BusinessErrors
>= v1.5.1
Definite vs indefinite errors
- Definite errors: errors when transaction definitely failed and user was not charged
- Indefinite errors: Requires additional checks for transaction status
- Other errors: errors not related to transaction processing
Definite errors: list
Library method signature:
- Android:
void handleTransactionError(ApiError apiError);
- iOS:
-(void) handleTransactionError: (ApiError *) error;
Invoked after TransactionLifecycleAdapter#timeout()
, before timeout handling.
Implementation should invoke WebtehWebView#stopLoading()
Library method signature:
- Android:
void threeDsLoaded();
- iOS:
-(void) threeDsLoaded;