Contact Information
Introduction
The Contact Information Service streamlines managing user contact details, enabling efficient real-time access and updates.
Key Features
- Provides a seamless method to retrieve all user contact details in one request.
- Ensures quick and straightforward updates to contact details.
Prerequisites
Before integrating the Contact Information Service, ensure you have:
- A valid Paysafe account with appropriate permissions.
- Set up instructions for Paysafe SDK Android or iOS.
To get started, initialize the ContactInformationService
instance in your app as shown below:
- Kotlin
- Swift
import com.paysafe.wallet.android.core.wallet.Wallet
val contactInformationService = Wallet.getInstance().getContactInformationService()
import PaysafeWallet
let contactInformationService = Wallet.instance.contactInformationService
Get Contact Information
Use the getAll
method to retrieve all contact information attributes, including their type, status, and creation date.
- Kotlin
- Swift
val parameters = GetContactInformationParameters(
ExtendedContactInformationType.MOBILE,
ExtendedContactInformationAttributeStatus.NOT_VERIFIED
)
val contactInformation = contactInformationService.getAll(parameters)
let parameters = Wallet.GetContactInformationParameters(
type: .mobile,
status: .notVerified
)
contactInformationService.getAll(parameters: parameters, completion: { result in
switch result {
case .success(let contactInfoList):
// Display contactInfoList
case .failure(let error):
// Handle error
}
})
Update Contact Information
Use the CustomerDataVerificationService to generate the verificationId
required for updating contact information.
- Kotlin
- Swift
Use the update
method to modify user contact information by providing the UpdateExtendedContactInfoConsumerRequest object with the updated contact details.
val updateRequest = UpdateExtendedContactInfoConsumerRequest(
type = ExtendedContactInformationType.EMAIL,
value = "john.doe@example.com",
verificationId = "06bdcd2c-0cce-4b36-97ec-281c8f5d743c"
val contactInformation = contactInformationService.update(updateRequest)
Use the update
method to modify user contact information by providing the UpdateExtendedContactInfoConsumerRequest object with the updated contact details.
let updateRequest = Wallet.UpdateExtendedContactInfoConsumerRequest(
type: .email,
value: "john.doe@example.com",
verificationID: "06bdcd2c-0cce-4b36-97ec-281c8f5d743c"
)
contactInformationService.update(request: updateRequest, completion: { result in
switch result {
case .success(let contactInfo):
// Display contactInfo
case .failure(let error):
// Handle error
}
})