CardDigitizationService
public final actor CardDigitizationService
This service is used to digitize and enrol a card.
-
Data returned by
See morecheckEligibility(_:instrumentData:)method.Declaration
Swift
public struct EligibilityAcceptableData : SendableReturn Value
termsAndConditionsandissuerData -
eventStreamAsynchronousAwaits the result from
digitizeCard(withTNC:pushToken:language:authenticationToken:).Declaration
Swift
public var eventStream: AsyncStream<State> { get async }Return Value
Stream of
State. -
Initializes the Card Digitization service.
Declaration
Swift
public init() -
checkEligibility(_:AsynchronousinstrumentData: ) Performs an eligibility check for card provisioning.
This method is the first step in the card provisioning flow, where the cardholder initiates digitization from the issuer’s application. It checks if a card is eligible for digitization by sending a request to the server with the provided eligibility data and
InstrumentDataDeclaration
Swift
public func checkEligibility( _ eligibilityData: EligibilityData, instrumentData: InstrumentData ) async throws -> EligibilityAcceptableDataParameters
eligibilityDataEligibilityDataA struct containing the details required for the eligibility check.instrumentDataInstrumentDataA struct containing the encrpted card details.Return Value
Throws:
networkErrorif there is a network connectivity error or connection timeout.serverError(_:)if there is any server error or communication error.clientError(_:)if theeligibilityDataorinstrumentDataare invalid.fpanNotEligibleif the FPAN is not eligible.cardAlreadyProvisionedInWalletif card is already provisioned in wallet.unknownIssuerIDif issuer ID is unknown.unknownCardIDif card ID is unknown.unknownWalletProviderIDif wallet provider ID is unknown.unknownBINif BIN is unknown.unknownCardProductif card product is unknown.unknownWalletApplicationIDif wallet application ID is unknown.cardProductNotSupportedif card product is not supported.incorrectCVVif CVV is incorrect.deviceNotEligibleif device is not eligible.exceedCountForCardProvisioningif card provisioning count has exceeded.unexpectedInternalErrorif there is an unexpencted internal error.externalSystemUnavailableif external system is unavailable.operationAlreadyOngoingif there is an ongoing operation.invalidCardDataif card data is invalid.resourceNotFoundif the requested resource cannot found.- Else,
unknown(_:)if an unexpected error encountered.
-
checkEligibility(_:AsynchronouspushSessionID: ) Eligibility check with
pushSessionIDhas to be used in the Backend-to-Backend Push Card Enrollment. The wallet server will first push the payment instrument to the Thales server. In return, the Thales server will return thepushSessionIDto be passed to thecheckEligibilityAPI to check if payment instrument is eligible for digitization.Since
7.3.0
Declaration
Swift
public func checkEligibility( _ eligibilityData: EligibilityData, pushSessionID: String ) async throws -> EligibilityAcceptableDataParameters
eligibilityDataEligibilityDataA struct containing the details required for the eligibility check.pushSessionIDThe push session ID (0–255 chars) received from TSHPay backend to the issuer.
Return Value
Throws:
networkErrorif there is a network connectivity error or connection timeout.serverError(_:)if there is any server error or communication error.clientError(_:)if theeligibilityDataorpushSessionIDare invalid.unknownWalletApplicationIDif wallet application ID is unknown.deviceNotEligibleif device is not eligible.exceedCountForCardProvisioningif card provisioning count has exceeded.unexpectedInternalErrorif there is an unexpencted internal error.externalSystemUnavailableif external system is unavailable.invalidPushSessionIDifpushSessionIDis not found or invalid- Else,
unknown(_:)if an unexpected error encountered.
-
Begins the digitization process. When
checkEligibility(_:instrumentData:)returnsTermsAndConditionsinEligibilityAcceptableData, MPA has to accept it and pass it as a parameter to start the card digitization process. Application should calleventStreamto handle each event.Throws:
networkErrorif there is a network connectivity error or connection timeout.serverError(_:)if there is a server error or an internal error.clientError(_:)if the request contains invalid data.fpanNotEligibleif the FPAN is not eligible.exceededCountForCardProvisioningif card provisioning count has exceeded.cardStateDoesNotAllowRequestedOperationif card state does not allow requested operation.invalidCardDataif card data is invalid.operationFailedif operation failed.unknownDeviceIDif device ID is unknown.unknownIssuerIDif issuer ID is unknown.unknownCardIDif card ID is unknown.unknownWalletProviderIDif wallet provider ID is unknown.unknownWalletIDif wallet ID is unknown.unknownDigitalCardIDif digital card ID is unknown.unknownCorrelationIDif correlation ID is unknown.unknownCardProductif card product is unknown.unexpectedInternalErrorif there is an unexpencted internal error.provisioningNotAllowedif card provisioning is not allowed.incorrectOTPMaxTryExceededif incorrect OTP mac try is exceeded.incorrectAuthenticationTokenif authentication token is incorrect.idvMethodNotAvailableif IDV method is not available.externalSystemUnavailableif external System is not available.operationAlreadyOngoingif there is an ongoing operation.missingRequiredParameterif there is a missing required parameter.web3DSAuthenticationErrorif there is a 3DS authentication error.web3DSDataErrorif there is a 3DS data error.- Else,
unknown(_:)if an unexpected error encountered.
Declaration
Swift
public func digitizeCard( withTNC tnc: TermsAndConditionsSession, pushToken: String, language: String, authenticationToken: Data? = nil ) async throwsParameters
tncThe value from MPA to accept the termsAndConditions.
pushTokenfcm token
languageThe ISO 639 language code chosen by the user when the mobile wallet is installed
authenticationTokentoken used for green card enrollment flow or null otherwise.
-
getPendingCardActivationSession(forDigitalCardID:Asynchronous) Returns the
PendingCardActivationSessionobject. It is used to resume the card activation process.Declaration
Swift
public func getPendingCardActivationSession( forDigitalCardID digitalCardID: String ) async -> PendingCardActivationSession? -
Card enrollment service error
See moreDeclaration
Swift
public enum Error : Sendable, Swift.Error -
The different verification/authentication methods used to verify the cardholder’s identify.
See moreDeclaration
Swift
public struct IDVMethod : Sendable -
The object used to list and select IDV method for card activation.
See moreDeclaration
Swift
public struct IDVMethodSelector : Sendable -
See moreTermsAndConditionsprovides the contents in the Terms and Conditions and the option to accept it.Declaration
Swift
public struct TermsAndConditions : Sendable -
See morePendingCardActivationindicates the card which was previously interrupted during activation.Declaration
Swift
public struct PendingCardActivation : Sendable -
See morePendingCardActivationSessionindicates the card which the Id&V has not been performed.Declaration
Swift
public struct PendingCardActivationSession : Sendable -
See moreEligibilityDatais used by MPA to provide information associated with the card digitization.Declaration
Swift
public struct EligibilityData : Sendable -
Components used to build
See moreEligibilityData.Declaration
Swift
public struct EligibilityDataComponents : Sendable -
InstrumentDatais used by MPA forcheckEligibility(_:instrumentData:).Declaration
Swift
public struct InstrumentData : Sendable, Codable -
Components of
See moreInstrumentData.Declaration
Swift
public struct InstrumentDataComponents : Sendable -
IssuerData contains the information of the issuer.
See moreDeclaration
Swift
public struct IssuerData : Sendable -
State of the card digitization process that is initiated with
See moredigitizeCard(withTNC:pushToken:language:authenticationToken:)Declaration
Swift
public enum State : Sendable -
TermsAndConditionsSession provides the correlation ID and timestamp of the session.
Declaration
Swift
public struct TermsAndConditionsSession : Sendable
CardDigitizationService Actor Reference