DigitalCardManager
public actor DigitalCardManager
Gives access to the list of available digitalCards, obtaining a specified digitalCard, retrieving the default payment card and unsetting the default status of a card.
Also allows card operations such as suspend, resume or deletion of a specified digitalCard.
-
Initializes the Digital Card Manager
Declaration
Swift
public init() -
eventStreamAsynchronousToken Sync process state as an AsyncStream Await the result from
invokeDigitalCardSync()Declaration
Swift
public var eventStream: AsyncStream<SyncEvent> { get async }Return Value
The current state of the synchronization process as
DigitalCardManager.SyncState -
unsetDefaultCard()AsynchronousRemoves the current default payment card.
Declaration
Swift
@discardableResult public func unsetDefaultCard() async throws -> BoolReturn Value
Boolean. True if operation was successful. > Throws: > -
deviceEnvironmentUnsafe(_:)if device environment is unsafe. > -clientError(_:)if there is any internal failure. > - Else,unknown(_:)- if an unexpected error encountered. -
digitalCard(forID:Asynchronous) Retrieves a
DigitalCard.Declaration
Swift
public func digitalCard(forID digitalCardID: String) async -> DigitalCard?Parameters
digitalCardIDdigitalCard ID
Return Value
digitalCard:
DigitalCardobject with the specifieddigitalCardID. -
invokeDigitalCardSync()AsynchronousBegins the synchronization process returning its state in an asyncStream. Result returned in
eventStreamThrows:
clientError(_:)if there is any internal failure.serverError(_:)if server error encountered.networkErrorif there is a network connectivity error or connection timeout.
Declaration
Swift
public func invokeDigitalCardSync() async throws -
isDigitalCardSyncAllowedAsynchronousWhether or not digital card synchronization is allowed.
Throws:
clientError(_:)if there is any internal failure.- Else,
unknown(_:)- if an unexpected error encountered.
Declaration
Swift
public var isDigitalCardSyncAllowed: Bool { get async throws } -
digitalCardSyncScheduleAsynchronousTimeInterval: The number of seconds until the next digital card synchronization.
Throws:
clientError(_:)if there is any internal failure.- Else,
unknown(_:)- if an unexpected error encountered.
Declaration
Swift
public var digitalCardSyncSchedule: TimeInterval { get async throws } -
cardListAsynchronousRetrieves an array containing all the available
DigitalCard.Declaration
Swift
public var cardList: [DigitalCard] { get async throws }Return Value
[DigitalCard]array of digital cards. > Throws: > -deviceEnvironmentUnsafe(_:)if device environment is unsafe. > -clientError(_:)if there is any internal failure. > - Else,unknown(_:)- if an unexpected error encountered. -
defaultCardAsynchronousRetrieves the current default payment card.
Declaration
Swift
public var defaultCard: DigitalCard? { get async throws }Return Value
String:
DigitalCardIDof the default card. > Throws: > -deviceEnvironmentUnsafe(_:)if device environment is unsafe. > -clientError(_:)if there is any internal failure. > - Else,unknown(_:)- if an unexpected error encountered. -
Actions available to the
See moremanage(digitalCardID:action:)operation.Declaration
Swift
public enum CardManagementAction : Sendable -
manage(digitalCardID:Asynchronousaction: ) Perform a management action on a specific
DigitalCard.- The actions available are :
- Suspend
- Resume
- Delete
Throws:
incorrectAuthenticationTokenif authentication token is incorrect.unknownWalletProviderIDif wallet provider ID is unknown.unknownWalletIDif wallet ID is unknown.unknownDigitalCardIDif digital card ID is unknown.cardStateDoesNotAllowRequestedOperationif the card state does not allow the requested operations.operationAlreadyOngoingif there is an ongoing operation.unexpectedInternalErrorif an unexpected internal error is encountered.externalSystemUnavailableif external system is unavailable.unknownIssuerIDif issuer ID is unknown.unknownCardIDif card ID is unknown.clientError(_:)if any internal errors are encountered.networkErrorif there is a network connectivity error or connection timeout.serverError(_:)if error encountered during card operations.- Else,
unknown(_:)if an unexpected error encountered.
Declaration
Swift
public func manage(digitalCardID: String, action: DigitalCardManager.CardManagementAction) async throws -> String?Parameters
digitalCardIDID of the
DigitalCardto perfrom the action on.actionReturn Value
DigitalCardIDof the operation if successful. - The actions available are :
-
Declaration
Swift
public enum ManageCardError : Sendable, Swift.Error -
DigitalCardManager error Possible APIS which uses Error
See moreDeclaration
Swift
public enum Error : Sendable, Swift.Error -
The states that occur during digital card sync stream..
See moreDeclaration
Swift
public enum SyncEvent : Sendable -
Status of a digital card sync operation
See moreDeclaration
Swift
public enum SyncStatus : UInt, Equatable, Sendable
DigitalCardManager Actor Reference