Handle Visa multiple AIDs
Last updated
Was this helpful?
Was this helpful?
// Get a reference to a digital card using its tokenId.
DigitalizedCard digitalizedCard = DigitalizedCardManager.getDigitalizedCard(tokenId);
// Check whether this digital card exposes multiple AIDs.
if (digitalizedCard.isMultiAids()) {
// Read all AIDs. The list is sorted by priority (highest first).
List<Aid> aids = digitalizedCard.getAllAids();
// Lock the highest-priority AID.
aids.get(0).setLockStatus(true);
// Rebuild the list in the desired priority order.
// IMPORTANT: The updated list must contain all AIDs.
List<Aid> updatedAids = new ArrayList<>();
updatedAids.add(aids.get(1));
updatedAids.add(aids.get(0));
// Add remaining AIDs in the required order.
// Apply both the new priority and lock status changes.
digitalizedCard.updateAidList(updatedAids);
}