> 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-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/set-the-default-payment-card.md).

# デフォルトの支払いカードを設定する

## 概要

デフォルトのデジタルカードは、あなたの **デジタルウォレットアプリケーション** が非接触決済のために自動的に選択するカードです。

この **エンドユーザー** はデフォルトのデジタルカードを保持することも、支払いを確定する前にあなたのUIでカードを切り替えることもできます。

参照してください [非接触決済を実装する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/make-payment/implement-contactless-payments.md).

## SDK 統合

### デフォルトの支払いカードを設定する

呼び出す `DigitalizedCard.setDefault()` を `DigitalizedCard` に対してデフォルトとして設定します。

{% hint style="warning" %}
デジタルカードをデフォルトとして設定する前に、それがアクティブであり、少なくとも1回の支払いが残っている（支払いキー）ことを確認してください。カードのステータスと支払いキーのステータスフィールドを使用して両方を検証します。 [デジタルカードを表示する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/display-digital-cards.md#retrieve-digital-card-information) で検証してください。

* 呼び出す `DigitalizedCardStatus.getState()` でカードの状態を確認します。
* 呼び出す `DigitalizedCardStatus.getNumberOfPaymentsLeft()` で残りの支払い回数を確認します。
  {% endhint %}

以下の例は、非接触決済のためのデフォルトデジタルカードを設定します。

{% code title="SetDefaultCard.java" %}

```java
public void setDefault(final DigitalizedCard digitalizedCard) {
    digitalizedCard.setDefault(
        PaymentType.CONTACTLESS,
        new AsyncHandlerVoid(new AsyncHandlerVoid.Delegate() {
            @Override
            public void onSuccess() {
                // デフォルトカードが正常に設定されました。
            }

            @Override
            public void onError(final String error) {
                // TODO: エラーを処理する
            }
        })
    );
}
```

{% endcode %}

### `DigitalizedCardManager` によるデフォルトカード管理

`DigitalizedCardManager` はデフォルトカード管理のための追加APIを提供します：

* `DigitalizedCardManager.getDefault()`：取得する **トークン化されたカードID** をデフォルトカードのために。
* `DigitalizedCardManager.unsetDefaultCard()`：現在のデフォルトカードの設定を解除します。その後、デフォルトで選択されるカードはありません。


---

# 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-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/set-the-default-payment-card.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.
