Skip to main content

Customer Info

This section refers to CustomerDetail and CustomerInfo modules.

Flow overviewFlowchart of this module's usage within the SDK flow. Expand to view it, click the chart to enlarge.

Customer Info flow

  • U1, U2: set AmaniDelegate with setDelegate(delegate:), then start the session with initAmani(...) (optional SSL pinning before it).
  • After that, each call is independent: call it whenever your app needs it, e.g. on a button tap, in any order.
  • U3: customerInfo().getCustomer() to show the customer's data.
  • U4: setInfo(occupation:address:), then upload(location:); call setInfo before every upload.
  • U5: enablePin(_:) / disablePin; the result is .success or .failure.

Getting the Detailed Customer Information​

↑ Flow step U3

To get the latest updated details about the customer, you can call getCustomerDetail method.

Amani.sharedInstance.customerInfo().getCustomer()

πŸ“„ CustomerDetailResult Fields​

Property NameData TypeDescription
addressAny?Customer's address; can be various types (String, Map, etc.)
birthdateString?Date of birth (format: YYYY-MM-DD)
emailAny?Email address; type may vary
idString?Unique identifier of the customer
idCardNumberString?National ID or card number
nameString?Full name of the customer
occupationAny?Customer’s job or profession
phoneString?Phone number; may be String or other
riskString?Risk level (e.g., "NORMAL", "HIGH", "VERY_HIGH" )
rules[KYCRuleModel]?List of applied verification rules
statusString?Current status (e.g., "PENDING", "APPROVED", "REJECTED")
amlStatusBool?AML (Anti-Money Laundering) check result
missingRules[KYCRuleModel]?Verification rules that are missing or failed
emailVerifiedBool?Whether the email address has been verified
phoneVerifiedBool?Whether the phone number has been verified
bioMatchEnabledBool?Whether biometric verification is enabled

Updating the Customer​

↑ Flow step U4

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​

↑ Flow step U4

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​

↑ Flow step U5

  • If the bioMatchEnabled parameter is returned as true from the getCustomer 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​

↑ Flow step U5

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
}
}