Display Card Details
Overview
This guide explains how to securely display full card details (PAN, expiry date, cardholder name, and CVV2/dCVV2) with the D1 SDK.
You have two approaches:
Get the card details and render them yourself in the issuer application UI.
Delegate the rendering to the D1 SDK to minimize data exposure.
User experience

Option 1: get the card details
In this approach, the issuer application calls getCardDetails() to retrieve the full card information and is responsible for rendering it.
To protect confidentiality, the D1 SDK returns values as byte arrays rather than plain text strings. You can retrieve:
PAN
Expiry date
Cardholder name (end user) — optional
CVV2 or dCVV2
Sequence diagram
Prerequisites:
End user and cards are registered in D1.
D1 SDK is properly initialised.
Issuer Application called D1 SDK login API.

D1 SDK Integration
Option 2: delegate display to the D1 SDK
To reduce PAN exposure, use displayCardDetails. Unlike getCardDetails, this API does not return card data. Instead, you pass UI components via CardDetailsUI, and the D1 SDK sets their text content securely. The issuer application retains full control of styling and layout.
CardDetailsUI provides:
setPanMaskCharacterto set the PAN mask character formaskCardDetails(default:*).setPanSeparatorCharacterto set the PAN separator every 4 digits (default: space).setExpiryDateFormatto set the expiry date format (default:MM/YY).insecureCopyToClipboardto copy the PAN to the system clipboard. Not recommended.
The following values can be displayed:
PAN
Expiry date
Cardholder name (end user) — optional
CVV2 or dCVV2
Sequence diagram
Prerequisites:
End user and cards are registered in D1.
D1 SDK is properly initialised.
Issuer application called D1 SDK login API.

CardDetailsUI contains DisplayTextView (Android) and D1DisplayTextField (iOS), which subclass the native TextView and UITextField. To limit exposure, getText() is restricted.
Refer to the Android security guidelines to obfuscate DisplayTextView.
D1 SDK Integration
Mask and show card details
For convenience, CardDetailsUI lets you mask and show card details:
maskCardDetailsmasks the details.showCardDetailsshows the details. For security, this always refetches data from the server.
Last updated
Was this helpful?