Skip to main content

3.3.1 Login

The following classes and interfaces are used to log in and do activation from the SDK. Login flow can be seen in Figure below.

Login Flow
image 1

3.3.1.1 Login with PIN

Login with the usual validation username and password before processing the payment. The login process is provided in CLLoginHandler, set the user name (Username) and PIN contained in the CLLoginHandler before using them as parameters in the Login method. If the login process is successful then the callback is onLoginSuccess and can be seen in ICLLoginService, otherwise if the login process fails then the callback is onLoginError and can be seen in ICLLoginService.

3.3.1.2 Login with Aggregator

Aggregator login is a different type of login from normal login, using aggregator data to log in. It's easier than regular login so there's no need to set a username and PIN, just set up doLoginAggregator. If the login process is successful then the callback is onLoginSuccess and can be seen in ICLLoginService, otherwise if the login process fails then the callback is onLoginError and can be seen in ICLLoginService.

3.3.1.3 ICLLoginHandler

The ICLLoginHandler class is used to login using the SDK. There are two ways to log in (Table ICLLoginResponse): log in using PIN and with Aggregator Login. Login with pin is the authentication used as in Cashlez App, each user has its own pin. Login with aggregator login can be used if a third-party application wants to log in on behalf of their user.

ICLLoginHandler Methods
void doLogin(String userName, String pin);
void doLogin(String serverPublicKey, String clientPublicKey, String mobileUserId, String aggregatorId);

ICLLoginHandler
MethodsDescription
doLogin(String userName, String pin);Login process using PIN
doLogin(String serverPublicKey, String clientPublicKey, String mobileUserId, StringaggregatorId);Login process using Aggregator

3.3.1.4 ICLLoginService

CLLoginService is a protocol provided by CLLoginHandler. It will return a login response through the delegate method whenever it success or error. Make sure that protocol is placed in class and set delegate from CLLoginHandler before doing login.

If activation success, thenICLLoginServicereturns and will show to the main menu.
onStartActivation(String mobileUpdateURL);

If Login success, thenICLLoginServicereturns and will show to the main menu.
onLoginSuccess(CLLoginResponseclLoginResponse);

And If authentication failed system will show an alert error message on onLoginError
onLoginError(CLErrorResponseerrorResponse);

In CLErrorResponse If there is an error in this class it will show the reason why the error occurred like errorCode, hostErrorCode, or httpStatusCode.

ICLLoginService
MethodsDescription
onStartActivation(String mobileUpdateUrl);Function is used if the activation is successful
onLoginSuccess(CLLoginResponse response)Callback / Reverse login process is successful
onLoginError(CLErrorResponse error)Callback / Reverse login process is successful