Customer Info
This section refers to CustomerDetail and CustomerInfo modules.
Getting the Detailed Customer Informationβ
To get the latest updated details about the customer, you can call
getCustomerDetail method.
Amani.sharedInstance().CustomerDetail().getCustomerDetail(object : CustomerDetailObserver {
override fun result(customerDetail: CustomerDetailResult?, throwable: Throwable?) {
if (customerDetail != null) {
//Customer detail fetched successfully
}
if (throwable != null) {
//Error happened during fetch process
}
}
})
π CustomerDetailResult Fieldsβ
| Property Name | Data Type | Description |
|---|---|---|
address | Any? | Customer's address; can be various types (String, Map, etc.) |
birthdate | String? | Date of birth (format: YYYY-MM-DD) |
email | Any? | Email address; type may vary |
gender | Any? | Gender of the customer; flexible type |
id | String? | Unique identifier of the customer |
idCardNumber | String? | National ID or card number |
name | String? | Full name of the customer |
nationality | Any? | Nationality; can be different formats |
occupation | Any? | Customerβs job or profession |
phone | Any? | Phone number; may be String or other |
photo | String? | Customerβs photo (URL or base64 encoded) |
rejectReason | Any? | Reason for verification rejection |
risk | String? | Risk level (e.g., "NORMAL", "HIGH", "VERY_HIGH" ) |
rules | List<Rule>? | List of applied verification rules |
status | String? | Current status (e.g., "PENDING", "APPROVED", "REJECTED") |
amlStatus | Boolean? | AML (Anti-Money Laundering) check result |
verificationSteps | List<String?>? | Steps taken during verification |
missingRules | List<MissingRule?>? | Verification rules that are missing or failed |
emailVerified | Boolean? = false | Whether the email address has been verified |
phoneVerified | Boolean? = false | Whether the phone number has been verified |
bioMatchEnabled | Boolean? = null | Whether biometric verification is enabled |
Updating the Customerβ
You can just call the setInfo method as shown in the example below.
Amani.sharedInstance().CustomerInfo().setInfo(
city = "New York",
province = "New York",
address = "123 Main Street, Manhattan",
occupation = "Software Developer",
phoneNumber = "+1 212 555 7890",
email = "john.doe@example.com",
fullName = "John Doe",
birthDate = "1988-07-22"
)
note
All the fields in this function are optionals.
If you give them null and call upload it'll remove those fields from our side.
If you don't call the upload method, it won't update.
Uploading the Updated Customer Dataβ
After calling the setInfo, you must call the `upload to reflect the changes
to our system.
Amani.sharedInstance().CustomerInfo().upload { isSuccess ->
if (isSuccess) {
// Uploading CustomerInfo is successful.
}
}
β Enable PINβ
- If the
bioMatchEnabledparameter is returned astruefrom thegetCustomerDetailfunction, you can use it to check in advance whether PIN authentication is active.
Use enablePin() to activate a PIN for the current customer.
Amani.sharedInstance().CustomerInfo().enablePin(
pin = "4444", // 4-digit numeric PIN
callback = object : PINCallback {
override fun onSuccess() {
// PIN successfully enabled
}
override fun onError(exception: Exception) {
Log.e(TAG, "PIN enabling failed! $exception")
}
}
)