ContactUs
Introduction
The ContactUs service provides a way for users to contact customer support by submitting support messages with categorized topics. The service allows you to fetch available support categories and topics, and create support messages.
Key Features:
- Fetch available support categories and their associated topics
- Filter categorization by specific categories or topics
- Submit customer support messages with category, topic, and message content
Prerequisites
Before integrating the ContactUs 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 ContactUsService instance in your app as shown below:
- Kotlin
- Swift
import com.paysafe.wallet.android.core.wallet.Wallet
val contactUsService = Wallet.getInstance().getContactUsService()
import PaysafeWallet
let contactUsService = Wallet.instance.contactUsService
Get Contact Us Categorization
- Kotlin
- Swift
Use getContactUsCategorization to retrieve all available categories and their associated topics used to create a support request.
This method returns a ContactUsCategorization object containing a list of categories, where each category has a code and a list of topic codes.
contactUsService.getContactUsCategorization(
categories = null,
topics = null
)
Use getContactUsCategorization to retrieve all available categories and their associated topics used to create a support request. This method returns a ContactUsCategorization object containing a list of categories, where each category has a code and a list of topic codes.
import PaysafeWallet
contactUsService.getContactUsCategorization { result in
switch result {
case .success(let categorization):
// Handle categorizations
case .failure(let error):
// Handle error
break
}
}
Get Filtered Contact Us Categorization
You can also filter the categorization by providing specific categories or topics. This is useful when you only need to display a subset of available options.
- Kotlin
- Swift
try {
val result = contactUsService.getContactUsCategorization(
categories = listOf("DEPOSITS_TRANSFERS", "SECURITY_ACCESS"),
topics = listOf("MISSING_DEPOSIT", "RESTRICTED_ACCOUNT")
)
// Display result
} catch (e: Exception) {
// Handle errors
}
import PaysafeWallet
contactUsService.getContactUsCategorization(
categories: ["DEPOSITS_TRANSFERS", "SECURITY_ACCESS"],
topics: ["MISSING_DEPOSIT", "RESTRICTED_ACCOUNT"]
) { result in
switch result {
case .success(let categorization):
// Handle filtered categorization
case .failure(let error):
// Handle error
break
}
}
Create Contact Us Message
Use createContactUsMessage to submit a customer support message. You need to provide a ContactUsMessageRequest containing:
category: The category code (must be one of the values fromgetContactUsCategorization)topic: The topic code within the selected category (must be one of the values fromgetContactUsCategorization)message: The customer's support message (maximum 5000 characters)
The category and topic codes must be valid values returned by getContactUsCategorization. The message cannot exceed 5000 characters.
- Kotlin
- Swift
import com.paysafe.wallet.android.core.contactus.model.ContactUsMessageRequest
val request = ContactUsMessageRequest(
category = "DEPOSITS_TRANSFERS",
topic = "MISSING_DEPOSIT",
message = "I'm experiencing issues with my payment. Please help."
)
try {
val response = contactUsService.createContactUsMessage(
request = request
)
// Handle response
} catch (e: Exception) {
// Handle error
}
import PaysafeWallet
let request = Wallet.ContactUsMessageRequest(
category: "DEPOSITS_TRANSFERS",
topic: "MISSING_DEPOSIT",
message: "I'm experiencing issues with my payment. Please help."
)
contactUsService.createContactUsMessage(request: request) { result in
switch result {
case .success(let response):
// Handle successful message creation
case .failure(let error):
// Handle error
break
}
}
The response contains:
id: Unique identifier for the created messagecategory: The category of the contact messagetopic: The topic within the categorymessage: The submitted message contentcreationTime: The timestamp when the message was created