Authorization History
Introduction
The Authorization history service allows retrieving customer's prepaid card authorizations and reviewing their details.
Key Features
- Retrieve a list of past prepaid card authorizations.
- View details of a specific authorization.
Prerequisites
Before integrating the Authorization History 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 AuthorizationHistoryService
instance in your app as shown below:
- Kotlin
- Swift
import com.paysafe.wallet.android.core.wallet.Wallet
val authorizationHistoryService = Wallet.getInstance().getAuthorizationHistoryService()
import PaysafeWallet
let authorizationHistoryService = Wallet.instance.authorizationHistoryService
Functionalities
Get Authorization History
- Kotlin
- Swift
Use getAuthorizationHistory
method to retrieve a list of all user authorizations.
Configure the filtering and pagination by providing an AuthorizationHistoryParameters
object.
The result is an AuthorizationList
object containing a list of Authorization
objects and a PagingResultMeta
object,
used for pagination implementation.
val parameters = AuthorizationHistoryParameters(
accountId = "1234567890",
limit = null,
offset = null, // adjust the offset to the desired starting position
startDate = null,
endDate = null,
status = null,
cardId = null
)
val authorizationList = authorizationHistoryService.getAuthorizationHistory(parameters)
Use getAuthorizationHistory
method to retrieve a list of all user authorizations.
Configure the filtering and pagination by providing an AuthorizationHistoryParameters
object.
The result is an AuthorizationList
object containing a list of Authorization
objects and a PagingResultMeta
object,
used for pagination implementation.
let parameters = Wallet.AuthorizationHistoryParameters(limit: nil,
offset: nil, // adjust the offset to the desired starting position
accountID: "1234567890",
cardID: nil,
startDate: nil,
endDate: nil,
status: nil)
authorizationHistoryService.getAuthorizationHistory(parameters: parameters, completion: { result in
switch result {
case .success(let authorizationList):
// Display authorizations in the list - authorizationList.authorizations
// Handle pagination
case .failure(let error):
// Handle error
}
})
Get Single Authorization
- Kotlin
- Swift
Use getAuthorization
method to retrieve a specific user authorization by ID. The result is an Authorization
object,
containing amounts,fees, creation time, challenge type and other various authorization details.
val authorizationId = "1234567890"
val authorization = authorizationHistoryService.getAuthorization(authorizationId)
Use getAuthorization
method to retrieve a specific user authorization by ID. The result is an Authorization
object,
containing amounts,fees, creation time, challenge type and other various authorization details.
let authorizationId = "1234567890"
authorizationHistoryService.getAuthorization(id: authorizationId, completion: { result in
switch result {
case .success(let authorization):
// Display authorization details
case .failure(let error):
// Handle error
}
})