Flashpay Decoupled Flow Android Integration
FlashPay solution primarily offers advanced biometric-based out-of-band (OOB) authentication. The Wibmo Tridentity SDK enables seamless integration of FlashPay functionality using various API methods and configuration options tailored to business needs.
Gradle Changes
Minimum Requirements
- Minimum SDK Version:
v23 - Compile SDK Version:
v33or later
Maven Dependency
To include the Tridentity SDK, add the following line to your app/build.gradle file:
implementation 'in.payu:tridentity-sdk:x.x.x-SNAPSHOT'Android Manifest Permissions
The SDK requires specific application-level permissions to enable its functionalities. As per business needs and enabled modes, these permissions must be declared in the AndroidManifest.xml file.
Supported Modes in SDK
- Biometric Based Authentication
Required Permissions
| Parameter | Description | Example |
|---|---|---|
Phone Statemandatory |
Mandatory to detect SIM swap scenarios. | android.permission.READ_PHONE_STATE |
SMSconditional |
For auto send of SMS if SDK is enabled for binding the device. | android.permission.SEND_SMS |
Include the following permissions in your AndroidManifest.xml file to enable the SDK functionalities:
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.SEND_SMS" />SDK Configuration
This is a prerequisite step where you invoke the SDK's configuration method to initialize client-specific details. Validation of security checks and required permissions also occurs during this phase.
Configuration Parameters
| Parameter | Description | Example |
|---|---|---|
contextmandatory |
Application Context | this |
clientIdmandatory |
String. Will be shared offline. |
"CLIENT_123" |
envmandatory |
String. Build Environment. |
"UAT" or "PROD" |
authTypemandatory |
String. Must be passed as "Biometric". |
"Biometric" |
binmandatory |
String. First 6 digits of the card used for the transaction. |
"123456" |
bankLogoUrloptional |
String. Logo of the issuer bank associated with the card. |
"https://example.com/bank-logo.png" |
merchantNameoptional |
String. Name of the recipient. |
"Sample Merchant" |
themeConfigoptional |
Theme configuration. Configures SDK appearance. If not passed, default settings or server-configured settings will be used. | themeConfigObject |
bankIdmandatory |
String. Identifier for the bank. |
"BANK_001" |
bindingTypeconditional |
String. Indicates if the card is the first for that bank. This parameter is mandatory if present in ACS response during Registration flow. Possible values: "01", "02", "03". |
"01" |
customerIdconditional |
String. Mandatory for transaction/de-registration flows. Mandatory in registration flow if bindingType is available. |
"CUST_12345" |
registrationTimeoutconditional |
Int. Specifies the maximum duration allowed for registration completion within the SDK. This value is mandatory during registration flow. |
300 |
transactionTimeoutconditional |
Int. Specifies the maximum duration allowed for authentication of transaction within the SDK. This value is mandatory during transaction flow. |
120 |
uidmandatory |
String. A unique identifier for the card. (dynamically retrieved from ACS). |
"CARD_UID_789" |
The SDK must be configured with client-specific details before any other methods can be used. Create a configuration object with the required parameters and call the configSdk method to initialize the SDK properly. Check the message flag in the onSuccess callback for configuration status:
TridentitySDK.getInstance().configSdk(context, configObject, object : ConfigStatusCallback {
override fun onSuccess(event: JSONObject) {
// Check the message flag in the event for configuration status
}
override fun onError(errorCode: Int, errorDesc: String) {
// Handle configuration error
}
})Once populated with these parameters, the configuration object is passed to the configSdk method to properly initialize the SDK, with callback handlers managing the configuration success or failure responses.
val configObject = JSONObject()
configObject.put("env", "UAT") // UAT or PROD
configObject.put("clientId", "")
configObject.put(“themeConfig”, “{themeConfig}”)
configObject.put(“bankId”,"8045")
configObject.put(“bindingType”, “02”)
configObject.put(“customerId”, "B81AEBFD8013D2F92B7DF38C00B20F168B18B3C27E78BAA721280189A5B86664")
configObject.put(“registrationTimeout”, 60)From the response object in the onSuccess method check for the message flag to get Configuration status.
Customer Enrollment
This method facilitates user enrollment for Tridentity-based authentication.
Enrollment Parameters
| Parameter | Description | Example |
|---|---|---|
activitymandatory |
Instance of AppCompatActivity. | this |
uidmandatory |
Card ID. | "CARD_UID_789" |
To enable biometric authentication for users, they must first be enrolled in the Tridentity system. Call the initiateRegistration method with the activity instance and registration object to begin the enrollment process. Check the message in the onSuccess response object for the registration status:
TridentitySDK.getInstance().initiateRegistration(activity, regObject, object : RegistrationStatusCallBack {
override fun onSuccess(event: JSONObject) {
// Check message in the event response object for the status
}
override fun onError(code: Int, error: String) {
// Handle registration error
}
})The registration object is then passed to the initiateRegistration method to begin the enrollment process, with callback handlers to manage success and error responses during the biometric setup workflow.
val regObject = JSONObject()
regObject.put("uid", "<>")
From the response object in the onSuccess method, check for the message flag to get the status
Check Registration Status
This method retrieves the customer's current registration status in the Tridentity system.
Registration Status Parameters
| Parameter | Description | Example |
|---|---|---|
contextmandatory |
Application Context | this |
clientIdmandatory |
Will be shared offline. | "CLIENT_123" |
Use the checkRegistrationStatus method to verify if a customer is already registered in the Tridentity system:
TridentitySDK.getInstance().checkRegistrationStatus(context, custObject, object : RegistrationStatusCallBack {
override fun onSuccess(event: JSONObject) {
// Handle successful status check
// Note: customerStatus : registration_comm_success is only considered as successful Registration.
}
override fun onError(code: Int, error: String) {
// Handle status check error
}
})The customer object is then passed to the checkRegistrationStatus method to perform the verification, with success callbacks specifically looking for a "registration_comm_success" status to confirm successful registration.
val custObject = JSONObject()
custObject.put("clientId", "<>") Process Transaction
This method processes transactions and validates them using biometric OOB authentication.
Transaction Parameters
| Parameter | Description | Example |
|---|---|---|
contextmandatory |
Application Context. | this |
jsonObjectmandatory |
JSON Object containing transaction parameters. | transactionObject |
Transaction JSON Object Parameters
| Parameter | Description | Example |
|---|---|---|
txnIdmandatory |
Unique for each transaction. Max length: 25 characters. No special chars like _,$,%,&. | "TXN123456789" |
clientIDmandatory |
Will be shared offline. | "CLIENT_123" |
amountoptional |
Total transaction amount. | "100.00" |
merchantNameoptional |
Merchant issuer name. | "Sample Merchant" |
hashKeymandatory |
Dynamically retrieved from the ACS. | "ABC123DEF456" |
Create a JSON object with the transaction details and call the processTransaction method to initiate biometric authentication for the transaction:
TridentitySDK.getInstance().processTransaction(context, jsonObject, object : UpdateTransactionCallback {
override fun onSuccess(event: JSONObject) {
// Handle successful transaction
}
override fun onError(code: Int, error: String) {
// Handle transaction error
}
})The populated transaction object is then passed to the processTransaction method to trigger the biometric authentication flow, allowing users to authorize transactions using their enrolled biometric credentials.
val custObject = JSONObject()
custObject.put("clientId", "<>")
custObject.put("txnId", "<>")
custObject.put("hashKey", "<>") Deregistration
This method is used to deregister a customer from the Tridentity service.
Call the deRegistration method to remove a customer from the Tridentity authentication system:
TridentitySDK.getInstance().deRegistration(context, object : DeregisterCallBack {
override fun onSuccess(event: JSONObject) {
// Handle successful deregistration
}
override fun onError(code: Int, error: String) {
// Handle deregistration error
}
})UI Customization
The SDK allows UI customizations through a configuration object passed in as themeConfig.
UI Customization Parameters
| Parameter | Description | Example |
|---|---|---|
LabelCustomizationoptional |
Configurations: headingCustomization, subHeadingCustomization. Sub Components: textColor, fontSize, fontName | labelConfigObject |
ToolbarCustomizationoptional |
Configurations: backgroundColor, textColor, fontSize, fontName | toolbarConfigObject |
ButtonCustomizationoptional |
Configurations: primaryButtonCustomization, secondaryButtonCustomization. Sub Components: buttonCornerRadius, fontSize, fontName, Enabled/disabled text & background color | buttonConfigObject |
Text Customization Parameters
bottomSheetPermissionPopupConfigurationoptional |
Text customization for permission popup: topHeaderText, topSubHeaderText, buttonText, etc. | permissionPopupConfig |
bottomSheetSimBindingProcessingPopupConfigurationoptional |
Texts for SIM binding, number verification, biometric setup, etc. | simBindingConfig |
bottomSheetRegistrationSuccessfulPopupConfigurationoptional |
Success messages and buttonText | registrationSuccessConfig |
bottomSheetFailureScreenConfigurationoptional |
Error messages and buttonText | failureScreenConfig |
Updated about 3 hours ago
