> 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/make-payment/optional-features.md).

# Optional features

### Overview

Use these implementation details to complete the payment flow.

Use these features only when they are supported by your payment experience.

### SDK

#### Display the authentication timer

Use `DeviceAuthenticationTimeoutCallback` to show the remaining time before the end user must tap again.

Register the callback with `registerDeviceAuthTimeoutCallback()` when the payment flow reaches `onReadyToTap()`.

This callback is useful for payment experiences that require a second tap, such as manual mode.

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

```java
ContactlessTransactionListener paymentCallback = new ContactlessTransactionListener() {

    @Override
    public void onReadyToTap() {
        // ...
        // Register the timeout callback to update the end user on the
        // remaining time before the second tap.
        D1PayConfigParams.getInstance()
            .getContactlessTransactionListener()
            .registerDeviceAuthTimeoutCallback(
                new DeviceAuthenticationTimeoutCallback() {
                    @Override
                    public void onTimer(int remain) {
                        // Update the countdown screen with the current
                        // remaining time.
                    }

                    @Override
                    public void onTimeout() {
                        // Inform the end user that authentication timed out.
                    }
                }
        );

        // Inform the end user to tap again and show the countdown screen
        // for the CDCVM validity period.
    }

    // ...
};
```

{% endtab %}
{% endtabs %}

#### Display transaction details

To improve the end user experience, the issuer application can display transaction details, such as amount, currency, and transaction type, when `TransactionData` is available.

Use the `TransactionData` object to access these values.

The callback that exposes `TransactionData` depends on the payment experience. For example, in manual mode, `TransactionData` is only available in `onTransactionCompleted()`.

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

```java
ContactlessTransactionListener paymentCallback = D1PayConfigParams.getInstance()
                                                                  .getContactlessTransactionListener();
TransactionData transaction = paymentCallback.getTransactionData();
```

{% endtab %}
{% endtabs %}

#### Enable or disable contactless payment

You can disable contactless payment by default and enable it only after the end user signs in and selects **Pay** in the issuer application.

After the D1 SDK initializes, call `D1PayWallet.setContactlessTransactionAllowed(false)`.

When the end user selects **Pay**, call `D1PayWallet.setContactlessTransactionAllowed(true)` to enable the contactless transaction.

{% hint style="warning" %}
Enable contactless payment for each transaction, then disable it again after the transaction completes or is canceled.
{% endhint %}


---

# 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/make-payment/optional-features.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.
