Requesting Manage Card
This method allows a 3rd party app to send a request to the Scan to Pay SDK in order for the cardholder to
“manage” their card list. Once invoked, the user is then able to add or delete bank cards.
Invoking the Manage Card Intent
The following snippet illustrates how to invoke the card management Intent:
Intent intent = new Intent(context, LibLiteWalletActivity.class);
intent.putExtra(LibLiteActivity.IN_API_KEY,"APIKEY");
intent.putExtra(LibLiteActivity.IN_SYSTEM, "LIVE");
context.startActivityForResult(intent, 10);
Values passed to the LibLiteWalletActivity
Name | Type | Description |
---|---|---|
LibLiteActivity.IN_API_KEY | String | This is the API key provided by Oltio/UKheshe that will enable the library to be used. This can be found on the Scan to Pay Portal under the Lib Lite Tokens menu item |
LibLiteActivity.IN_SYSTEM | String | This value can be “LIVE” or “TEST”, representing the Scan to Pay backend system to connect to. |
LibLiteActivity.IN_SUGGESTED_MSISDN | String | This is an optional field if you know the clients |
Handling the Manage Card Response
The following snippet illustrates how to handle the response from the LibLiteWalletActivity:
protected void onActivityResult(int requestCode, int resultCode, Intent data)
{ switch (requestCode) {case 10:
if (resultCode == LibLiteActivity.LIBLITE_ERROR) { int erra
} else if (resultCode == LibLiteActivity.LIBLITE_PAYMENT_SUCCESS)
{ String txReference = data.getStringExtra(LibLiteActivity.OUT_TX_REFERENCE); ...
} else if (resultCode == LibLiteActivity.LIBLITE_REGISTRATION_SUCCESS)
{ boolean silent = data.getBooleanExtra(LibLiteActivity.OUT_SILENT_REGISTRATION,false);
}
break;
}
The following is a breakdown of resultCodes:
Result Code | Description | Extra Values |
---|---|---|
LibLiteActivity.LIBLITE_ERROR | Returned if an error has occurred before the payment | LibLiteActivity.OUT_ERROR_CODE – This indicates the type of error that occurred. See the error table below LibLiteActivity.OUT_LOCATION - This is the location of the error. This can be used to debug the error when requesting support from Oltio. |
LibLiteActivity.LIBLITE_USER_CANCELLED | Returned if the user aborted the process | LibLiteActivity.OUT_LOCATION - This is the location where the user aborted. This can be used to determine where the user is dropping off. |
LibLiteActivity.LIBLITE_REGISTRATION_SUCCESS | Returned if the user has registered with Scan to Pay and has a usable card on file. | LibLiteActivity.OUT_SILENT_REGISTRATION True: The user did not have any interaction with the library. He/she was most probably already registered False: The user has some interaction with the library. |
Updated almost 2 years ago