For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

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:

  • setPanMaskCharacter to set the PAN mask character for maskCardDetails (default: *).

  • setPanSeparatorCharacter to set the PAN separator every 4 digits (default: space).

  • setExpiryDateFormat to set the expiry date format (default: MM/YY).

  • insecureCopyToClipboard to 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

Last updated

Was this helpful?