> 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/tokenize-a-card/check-card-eligibility.md).

# カードの有効性を確認する

## 概要

カードの有効性は、最初のステップです **トークン化**。これは、カードがトークン化できるかどうかを確認します **デジタルウォレットアプリケーション**.

NFC Wallet SDK は、Token Service Provider (TSP) で有効性を確認します。

カードが対象の場合、SDK は TSP から利用規約 (T\&C) を返します。T\&C を表示して **エンドユーザー** デジタル化の前に同意を取得します。

{% hint style="info" %}
お使いのプログラムによっては、 **利用規約** は必須ではない場合があります。
{% endhint %}

有効性の確認と（必要な場合の）T\&C への同意の後、次に進みます [カードをデジタル化する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/tokenize-a-card/digitize-a-card.md).

## SDK 連携

呼び出します `MGCardEnrollmentService.checkEligibility()` 確認するため **トークン化** 有効性。

次を提供してください:

* `有効性データ`
* 次のいずれか:
  * `機器データ`
  * `pushSessionId`

`有効性データ` には以下が含まれます:

* `言語`: 優先言語（例、 `en`).
* `inputMethod`: カード情報がどのように収集されたか（たとえば、 **イシュアアプリケーションによる認証** または手動入力）。

`機器データ` 次の項目から構築できます:

* `encryptedCardData`
* `issuerPushReceipt`

プッシュカード登録のユースケースでは、NFC Wallet のバックエンドは `pushSessionId` を **イシュアのバックエンドが**.

### カード資格情報で有効性を確認

ほとんどの場合、カード資格情報を使って有効性を確認します。PAN と有効期限を指定してください。必要に応じてカードセキュリティコード（CSC）も指定してください。

```java
// Enrollment Service のハンドラを取得
MGCardEnrollmentService enrollmentService =
        MobileGatewayManager.INSTANCE.getCardEnrollmentService();

// 暗号化されたカードデータと公開鍵からインストルメントデータを構築
InstrumentData instrumentData =
        new InstrumentData.EncryptedCardDataBuilder(encryptedCardInfo)
                .publicKeyIdentifier(pubKey)
                .build();

// 有効性データを構築
有効性Data 有効性Data =
        new 有効性Data.Builder(InputMethod.金融機関_APP, "en").build();

// リスナー Card有効性Listener で有効性を判定します
enrollmentService.check有効性(有効性Data, instrumentData, new Card有効性Listener() {
    @Override
    public void onSuccess(TermsAndConditions termsAndConditions, IssuerData issuerData) {
        // カードが有効であれば、T&C を取得します
        String tncContent = termsAndConditions.getContent();
        ContentType tncContentType = termsAndConditions.getContentType();

        // T&C を保存して表示します。
        // digitizeCard(...) を呼び出す前に同意を取得します。
    }

    @Override
    public void onError(MobileGatewayError error) {
        // カードが有効ではないか、リクエストに失敗しました。
        // エラーの理由を確認し、再試行するかフローを停止するかを判断します。
    }
});
```

### イシュアのプッシュレシートで有効性を確認する

イシュアは以下から登録を開始できます **イシュアアプリケーションによる認証**。このフローでは、イシュアアプリケーションがイシュアのプッシュレシートを送信します。その **デジタルウォレットアプリケーション** それを使用して構築します `機器データ`.

{% hint style="info" %}
あるイシュアのプッシュレシートを使用した登録 **イシュアのプッシュレシート** はMastercardでのみサポートされています。NFC WalletはMDES Token Connect仕様をサポートしています。
{% endhint %}

構築 `機器データ` イシュアのプッシュレシートを使用して。次に呼び出します `checkEligibility(...)` カード認証情報フローと同様です。

```java
final String type = "pushAccountReceipt"; // 定数
final String scheme = "MASTERCARD"; // Mastercard / MDES のみサポートされています
String payload = "..."; // イシュアアプリから受信したペイロード

// イシュアのプッシュレシートからインストゥルメントデータを構築します
InstrumentData instrumentData =
        new InstrumentData.イシュアPushReceiptBuilder(scheme, type, payload).build();
```

### プッシュカード登録セッションIDで有効性を確認する

アプリケーションで暗号化されたカード詳細を扱うのを避けるため、 **イシュアのバックエンドが** イシュアはカード詳細を直接 NFC Wallet バックエンドにプッシュできます。NFC Wallet バックエンドは、一時的なプッシュカード登録セッション ID（`pushSessionId`).

```java
// NFC Wallet バックエンドによって生成された pushSessionId を取得します
String pushSessionId = "....";

// Enrollment Service のハンドラを取得
MGCardEnrollmentService enrollmentService =
        MobileGatewayManager.INSTANCE.getCardEnrollmentService();

// カードの有効性を呼び出します
enrollmentService.checkEligibility(eligibilityData, pushSessionId, new Card有効性Listener() {
    @Override
    public void onSuccess(TermsAndConditions termsAndConditions, IssuerData issuerData) {
        // カードが有効であれば、T&C を取得します
        String tncContent = termsAndConditions.getContent();
        ContentType tncContentType = termsAndConditions.getContentType();

        // T&C を保存して表示します。
        // digitizeCard(...) を呼び出す前に同意を取得します。
    }

    @Override
    public void onError(MobileGatewayError error) {
        // カードが有効ではないか、リクエストに失敗しました。
    }
});
```

### 利用規約への同意

有効性の確認に成功したら、利用規約（T\&C）を **エンドユーザー** 必要な場合。

その後、エンドユーザーが同意したら、次を作成します `TermsAndConditionSession` そしてそれを次に渡します `digitizeCard(...)`。参照してください [カードをデジタル化する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/tokenize-a-card/digitize-a-card.md).

```java
// 有効性から TermsAndConditions を取得します。
// termsAndConditions.getContentType() に基づいて termsAndConditions.getContent() を表示します。
// その後、エンドユーザーが受諾したら:
TermsAndConditionSession tncSession = termsAndConditions.accept();
```

{% hint style="info" %}
この **デジタルウォレットアプリケーション** T\&C を表示し、同意を収集する責任があります（プログラムで必要な場合）。

プログラムで暗黙の同意が許可されている場合は、 `termsAndConditions.accept()` エンドユーザーとのやり取りなしで。
{% 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, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/implement-nfc-wallet/tokenize-a-card/check-card-eligibility.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
