Handle Visa Multiple AIDs
Last updated
Was this helpful?
Was this helpful?
var aidInfoList = try await digitalCard.aidInfoList
let isMultiAID = try await digitalCard.isMultiAID
var newAIDInfoList: [AIDInfo] = []
// Reorder the items as necessary:
newAIDInfoList.append(aidInfoList[3])
newAIDInfoList.append(aidInfoList[0])
newAIDInfoList.append(aidInfoList[1])
newAIDInfoList.append(aidInfoList[2])
// If the items do not need to be reordered,
// we can simply create a new copy from the original:
newAIDInfoList = aidInfoList
// Change the lockStatus of the AIDs as necessary:
newAIDInfoList[0].lockStatus = .locked
newAIDInfoList[1].lockStatus = .unlocked
// Set the new array of `AIDInfo` objects into the digitalCard:
try await digitalCard.setAIDInfoList(newAIDInfoList)