> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-payment/implement-nfc-payment/digitize-a-card/check-digital-card-state.md).

# Check digital card state

### Overview

Before you digitize a card for NFC Payment, first check the card digitization state.

### Flow

Use the D1 SDK in the issuer application to check the card digitization state. If the card is not digitized and the device is NFC-capable, display the `Enable NFC Payment` button. If the card is already digitized, or the issuer application does not meet the eligibility criteria, hide the `Enable NFC Payment` option.

The D1 SDK exposes the `getCardDigitizationState()` API to check the card digitization state.

The possible card digitization states are:

* `NOT_DIGITIZED`
  * Display the `Enable NFC Payment` button if the device is NFC-capable.
* `DIGITIZATION_IN_PROGRESS`
  * The card digitization process is already in progress. No action is required in the issuer application, and you cannot digitize another card at this time.
* `DIGITIZED`
  * No message is displayed. The card is already digitized.
  * The issuer application should check whether it is the default payment application in Android Tap & Pay settings.

### Sequence diagram

<figure><img src="/files/RqjfTbznGN9G08t01f6G" alt=""><figcaption><p>Card digitization state flow in the issuer application.</p></figcaption></figure>

### SDK

#### Check digital card state

{% tabs %}
{% tab title="Android Kotlin" %}

```kotlin
fun checkCardDigitizationState(d1Task: D1Task, cardID: String) {
    val callback: D1Task.Callback<CardDigitizationState> =
        object : D1Task.Callback<CardDigitizationState> {
            override fun onSuccess(state: CardDigitizationState) {
                // Update UI bases on the state value

                // Hide button "Enable NFC Payment"
                when (state) {
                    NOT_DIGITIZED -> {
                        // Check Device is Eligible
                        // Show button "Enable NFC Payment"
                    }

                    DIGITIZATION_IN_PROGRESS -> {
                        // Hide button "Enable NFC Payment"
                        // Show digitization in progress
                    }

                    DIGITIZED -> {
                        // Tap&Pay settings
                        // Check issuer application is the default payment application
                    }
                }
            }

            override fun onError(exception: D1Exception) {
                // Refer to D1 SDK Integration – Error Management section
                // Exception: Not Supported: Display message 'Not Supported'
            }
        }
    val d1PayWallet: D1PayWallet = d1Task.d1PayWallet
    d1PayWallet.getCardDigitizationState(cardID, callback)
}
```

{% endtab %}

{% tab title="Android Java" %}

```java
public void checkCardDigitizationState(@NonNull D1Task d1Task, @NonNull String cardID) {
    D1Task.Callback<CardDigitizationState> callback = new D1Task.Callback<CardDigitizationState>() {
        @Override
        public void onSuccess(@NonNull CardDigitizationState state) {
            // Update UI bases on the state value

            // Hide button "Enable NFC Payment"
            switch (state) {
                case NOT_DIGITIZED:
                    // Check Device is Eligible
                    // show button "Enable NFC Payment"
                    break;

                case DIGITIZATION_IN_PROGRESS:
                    // Hide button "Enable NFC Payment"
                    // Show digitization in progress
                    break;

                case DIGITIZED:
                    // Tap&Pay settings
                    // Check issuer application is the default payment application
                    break;
            }
        }

        @Override
        public void onError(@NonNull D1Exception exception) {
            // Refer to D1 SDK Integration – Error Management section
            // Exception: Not Supported: Display message 'Not Supported'
        }
    };
    D1PayWallet d1PayWallet = d1Task.getD1PayWallet();
    d1PayWallet.getCardDigitizationState(cardID, callback);
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-payment/implement-nfc-payment/digitize-a-card/check-digital-card-state.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
