Handle red flow
Overview
Sequence diagram
digitizationDeclined.Integrate SDK
Last updated
Was this helpful?
Was this helpful?
func digitizeCard(_ termsAndConditions: CardDigitizationService.TermsAndConditions) async throws {
// Step 1: Initialize the service.
let cardDigitizationService = CardDigitizationService()
let fcmToken: String = "FACY6074293608087656831WRF1234" // Example only.
// Step 2: Start digitization.
try await cardDigitizationService.digitizeCard(withTNC: termsAndConditions.accept(),
pushToken: fcmToken,
language: "en")
// Step 3: Listen for outcomes.
for await state in await cardDigitizationService.eventStream {
switch state {
case .digitizationDeclined:
// Red flow: Tokenization declined by the issuer backend.
// Show a decline message and stop the flow.
return
default:
break
}
}
}