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.customerInfo().getCustomer()
π 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 |
id | String? | Unique identifier of the customer |
idCardNumber | String? | National ID or card number |
name | String? | Full name of the customer |
occupation | Any? | Customerβs job or profession |
phone | String? | Phone number; may be String or other |
risk | String? | Risk level (e.g., "NORMAL" , "HIGH" , "VERY_HIGH" ) |
rules | [KYCRuleModel]? | List of applied verification rules |
status | String? | Current status (e.g., "PENDING" , "APPROVED" , "REJECTED" ) |
amlStatus | Bool? | AML (Anti-Money Laundering) check result |
missingRules | [KYCRuleModel]? | Verification rules that are missing or failed |
emailVerified | Bool? | Whether the email address has been verified |
phoneVerified | Bool? | Whether the phone number has been verified |
bioMatchEnabled | Bool? | Whether biometric verification is enabled |
Updating the Customerβ
You can just call the setInfo
method as shown in the example below.
var addressInfo:AddressInfo = AddressInfo(city: "City", address: "address", province: "Province")
Amani.sharedInstance.customerInfo().setInfo(occupation: "Occupation" , address: addressInfo)
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(location: nil){ ([weak self] (uploadSuccess, error) in
if (uploadSuccess != nil) {
// uploadSuccess is a boolean variable
// TODO: handle the upload state
} else if (error != nil) {
// TODO: handle the error
}
)}
β Enable PINβ
- If the
bioMatchEnabled
parameter is returned astrue
from thegetCustomer
function, you can use it to check in advance whether PIN authentication is active.
Use enablePin()
to activate a PIN for the current customer.
self.amaniSDK.customerInfo().enablePin("1234") { result in
switch result {
case .success(let model):
print(model)
case .failure(let error):
print(error)
default:
break
}
}
π« Disable PINβ
You can disable the previously enabled customer PIN using the disablePin()
function in the Amani SDK.
self.amaniSDK.customerInfo().disablePin { result in
switch result {
case .success(let model):
print(model)
case .failure(let error):
print(error)
default:
break
}
}