Profile Information
Introduction
The Profile Service provides a comprehensive solution for managing customer information within your mobile application. It offers easy access to key customer-related data, including profile details, accounts listings and balances, and the ability to add accounts in new currencies.
Key Features:
- Retrieve full customer profile: Access complete customer information, including personal details, restrictions and profile settings.
- Update customer profile: Modify customer details, such as name, address, occupation, etc..
- List all customer accounts: View all accounts associated with the customer.
- Retrieve single customer account: Access detailed information on a specific account.
- Add account in a new currency: Create a new account for the customer in a specified currency.
Prerequisites
Before integrating the Profile Service, ensure you have:
To get started, initiate the ProfileService
instance in your app as shown bellow:
- Kotlin
- Swift
import com.paysafe.wallet.android.core.wallet.Wallet
val profileService = Wallet.getInstance().getProfileService()
import PaysafeWallet
let profileService = Wallet.instance.profileService
Functionalities
Get Customer Profile
- Kotlin
- Swift
Use getProfile
method to retrieve the full customer's profile - CustomerInfo. Additional information can be requested by
adding one or more of the ProfileIncludes values to the include
parameter.
val include = listOf(
ProfileIncludes.ACCOUNTS,
ProfileIncludes.ADDRESS,
ProfileIncludes.CONTACTINFO
)
val profileInfo = profileService.getProfile(include)
Use getProfile
method to retrieve the full customer's profile - CustomerInfo. Additional information can be requested by
adding one or more of the ProfileIncludes values to the include
parameter.
profileService.getProfile(include: [.contactInfo], completion: { result in
switch result {
case .success(let customerInfo):
// Display customer information
case .failure(let error):
// Handle error
}
})
Update Profile Feature in development
This API is available only to merchants with standaloneWallet
access and walletSetup
scope to the config token.
Updating the following customer details might result in customer restriction and require new KYC Verification.
firstName
,lastName
- re-trigger KYC verificationaddress
- re-trigger address verification of KYC process
To update the following details, the customer must be non-KYC verified. If the customer is KYC verified, you cannot update these details:
birthDate
- Kotlin
- Swift
Use updateProfile
method to update customer's personal information by passing the UpdateCustomerRequest.
val updateCustomerRequest = UpdateCustomerRequest(
title = "Mr.",
firstName = "John",
lastName = "Doe",
birthDate = "1991-06-16",
nationality = "US",
occupation = Occupation.ENGINEERING,
vulnerabilities = listOf(Vulnerability.GAMBLING_ADDICTION),
address = UpdateAddressRequest(
stateProvince = "FL",
city = "Tallahassee",
postalCode = "32003",
address1 = "Traditions way 1",
address2 = "Apt. 101"
),
)
val fullCustomerInfo = profileService.updateProfile(updateCustomerRequest)
Use updateProfile
method to update customer's personal information by passing the UpdateCustomerRequest.
let request = Wallet.UpdateCustomerRequest(title: "Mr.",
firstName: "John",
lastName: "Doe",
birthDate: Date(timeIntervalSince1970: 677030400), nationality: "US",
occupation: .engineering,
vulnerabilities: [.gamblingAddiction],
address: .init(stateProvince: "FL",
city: "Tallahassee",
postalCode: "32003",
address1: "Traditions way 1",
address2: "Apt. 101"))
profileService.updateProfile(request: request,
completion: { result in
switch result {
case .success(let customerInfo):
// Display updated customer information
case .failure(let error):
// Handle error
}
})
Get Customer Accounts
Use getAccounts
method to retrieve all customer accounts. The result is a list of Account
objects, containing the
balance, currency code, etc.
- Kotlin
- Swift
val accounts = profileService.getAccounts()
profileService.getAccounts(completion: { result in
switch result {
case .success(let accounts):
// Display accounts
case .failure(let error):
// Handle error
}
})
Get Single Customer Account
Use getSingleAccount
method to retrieve a single Account
object by ID.
- Kotlin
- Swift
val account = profileService.getSingleAccount("1234567890")
profileService.getSingleAccount(accountID: "1234567890", completion: { result in
switch result {
case .success(let account):
// Display account
case .failure(let error):
// Handle error
}
})
Add Customer Account
Use addAccount
method to create a new account for the customer in a provided currency. The result will be the newly
created Account
object.
- Kotlin
- Swift
val addAccountRequest = AddAccountRequest(currencyCode = "EUR")
val account = profileService.addAccount(addAccountRequest)
let addAccountRequest = Wallet.AddAccountRequest(currencyCode: "EUR")
profileService.addAccount(request: addAccountRequest, completion: { result in
switch result {
case .success(let account):
// Display new account
case .failure(let error):
// Handle error
}
})