Skip to main content

Transition Guide (Android/Kotlin)

This file helps of finding the corresponding calls of MS8b and events of the MasterController. For further information about the calls and events itself, please use the documentation of either MS8b or MasterController.

Basics

The MS8b was an interface based connection between the app and the SDK. This interface needed to be implemented and was the central interface. The MasterController is now an event based connection between the app and the SDK. You need to implement an event interface where you can send and receive events from or to the SDK.

Init

MS8b

You created a class where all the callbacks were received inside the app. An instance of this class was then passed to the getSdk() method of the AstSdkFactory class to get SDK instance. public static AstSdk getSdk(Context context, AstSdkListener manageListener)

Previously you used AstStatus init(String locale, byte[] version, String appName); to start the SDK. This call was followed up by

Object getAppConfigParameter(AstConfigParameter parameter);

Which takes the configuration of the SDK

MasterController

You communicate with the MasterController by creating an instance of the class implementing the event interface.

The instance you create is then used to send events to the MasterController.

For MasterController you provide a class StartEvent extends EventFrameworkEvent which takes all the necessary configurations StartEvent(String locale, AppVersion version, String appName, String mcConfig, String certificateChain, String sdkConfig)

As a response you will receive class StartResultEvent extends AbstractStatusEvent

Depending on the status you need either to login or activate.

Activation

If you have no activated users/accounts on the device, you will get the activation callback/event after the successful init of the SDK or MasterController. The StartActivationUserIdAndCodeOnlyEvent is just an information event.

Quickview

MS8bMasterControllerDescription
onActivationBeginStartActivationUserIdAndCodeOnlyEventStart of activation flow
ProvideActivationCodeAndUserIdEvent
StartActivationSetPINEvent
ProvideSetPinEvent
onActivationEndKSMActivationResultEventEnd of activation flow

MS8b

The activation process is the sequence of the three calls:

void onActivationBegin(AstDeviceType deviceType);

void doActivation(AstDeviceType deviceType, String pin, String userID, String activationCode);

void onActivationEnd(AstDeviceType deviceType, AstStatus status);

After those calls you are either logged in or need to login.

MasterController

The process is now split up into two steps.

First step is to send user ID and activation code to the MasterController.

StartActivationUserIdAndCodeOnlyEvent

ProvideActivationCodeAndUserIdEvent

This is followed up by sending the PIN to the MasterController.

StartActivationSetPINEvent

ProvideSetPinEvent

For the result you will also receive an event which gives you the status of the activation process. After That you are either logged in or need to login

ActivationResultEvent

Login

If you have already activated users/accounts on the device, you will get the login callback/event after the successful init of the SDK or MasterController. The StartLoginEvent is just an information event.

Quickview

MS8bMasterControllerDescription
onLoginBeginStartLoginEventStart of login flow
doLoginLoginEventTrigger the login process
onLoginEnd LoginResultEventGet the result of the login process

MS8b

void onLoginBegin(AstDeviceType deviceType, List<String> userIdList);

void doLogin(AstDeviceType deviceType, String pin, String userId)

void onLoginEnd(AstDeviceType deviceType, AstStatus status, String loginOtp, String userId, int retryCounter, int retryDelay);

MasterController

The new events are similar to MS8b

StartLoginEvent

LoginEvent

LoginResultEvent

Transaction

Quickview

MS8bMasterControllerDescription
TriggerBannerEvent Information about an available transaction
onTransactionBlockBeginStartTransactionEventStart closure for transactionflow
onPinRequiredBeginTransactionPinRequiredRequestEventStart to verify the PIN
doPinRequiredProvidePinEventTrigger verification of the PIN
onPinRequiredEndProvidePinResultEventResult of PIN verification
onTransactionBeginDisplayConfirmationRequestEventReception of the transaction information
doTransactionDisplayConfirmationEventConfirm or decline of the transaction
onTransactionEndDisplayConfirmationResultEventResult of the confirmation or the decline
onTransactionBlockEndTransactionEndEventIndication that the transactionflow is finished

MS8b

For MS8b the SDK triggered the calls for the transaction itself and you had to react to it. All other SDK calls were then blocked by this process.

The calls that are wrapped around the transaction callbacks are

void onTransactionBlockBegin(AstDeviceType deviceType, int timeout);

void onTransactionBlockEnd(AstDeviceType deviceType);

If a PIN is needed for security reasons

void onPinRequiredBegin(AstDeviceType deviceType, AstPinReason reason)

void doPinRequired(AstDeviceType deviceType, AstConfirmation confirm, String pin)

void onPinRequiredEnd(AstDeviceType deviceType, AstStatus status, int retryCounter)

The transaction calls which require the confirmation are

void onTransactionBegin(AstDeviceType deviceType, String displayData, AstConfirmationType confirmationType)

void doTransaction(AstDeviceType deviceType, AstConfirmation confirm, String displayData)

void onTransactionEnd(AstDeviceType deviceType, AstStatus status)

MasterController

In the MasterController you will receive an event which tells you, that there is a transaction available, which you can then request when you are ready.

The event telling that a transaction is available is

TriggerBannerEvent

The MasterController is not blocked by this event flow until you trigger it.

Now you can start the event flow for the Transaction by sending the event to the MasterController

StartTransactionEvent

If you need extra security there is still the opportunity for using a PIN inside the transaction.

TransactionPinRequiredRequestEvent

ProvidePinEvent

ProvidePinResultEvent

The transaction calls with the information and to be confirmed are

DisplayConfirmationRequestEvent

DisplayConfirmationEvent

DisplayConfirmationResultEvent

The transaction process is wrapped up by the event

TransactionEndEvent

Change PIN

Quickview

MS8bMasterControllerDescription
doPinChangeRequestStartChangePinEventAsk for possibility of changing the pin
onPinChangeBeginStartSetNewPinEventStart of PIN change flow
doPinChangeProvideSetNewPinEventProvide old and new PIN
onPinChangeEndChangePinResultEventResult of PIN change

MS8b

For changing the PIN it is necessary to request the SDK for permission that it can trigger some communication flags that are needed. void doPinChangeRequest(AstDeviceType deviceType);

void onPinChangeBegin(AstDeviceType deviceType, AstStatus status);

void doPinChange(AstDeviceType deviceType, AstConfirmation confirm, String currentPin, String newPin);

void onPinChangeEnd(AstDeviceType deviceType, AstStatus status, int retryCounter);

MasterController

Also for the change PIN in the MasterController it is needed to ask for permission because the MasterController also needs to set some communication flags.

Therefore the flow of calls is close to the same like in MS8b

StartChangePinEvent

StartSetNewPinEvent

ProvideSetNewPinEvent

ChangePinResultEvent

Errors

MS8b

void onAlert(AstDeviceType deviceType, int subSystem, int errorCode);

void onReport(AstDeviceType deviceType, int reportId);

MasterController

WarningEvent

RuntimeErrorEvent

FatalErrorEvent