> 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/digitize-a-card/yellow-flow-digitization.md).

# イエローフローのデジタル化

## 概要

Yellow flow は **トークン化** フローであり、 **イシュアのバックエンドが** ステップアップ認証（**ID\&V**).

このフローは、NFC Wallet SDK が **デジタルウォレットアプリケーション** に統合され、複数のイシュアのカードをサポートする場合によく使われます。

このフローでは、 **エンドユーザー** Tokenization が完了する前に ID\&V を完了します。

## ユーザー体験

参照 [Yellow flow のユーザー体験](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/tokenize-a-card.md#yellow-flow).

## シーケンス図

<figure><img src="/files/ac2ead61c175dc9804fdeaa6204c60ae490eb42a" alt=""><figcaption><p>Yellow flow のデジタル化シーケンス。</p></figcaption></figure>

## SDK を統合する

あなたが次のことを行った後 [カードの利用資格を確認する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/tokenize-a-card/check-card-eligibility.md)、 `MGDigitizationListener` デジタル化の進行状況を追跡するために実装します。次に：

1. 呼び出します `MGCardEnrollmentService.digitizeCard(...)`.

   あなたの `MGDigitizationListener`.
2. イシュアのバックエンドがステップアップ認証（yellow flow）で Tokenization を承認すると、SDK は次のコールバックをトリガーします：
   1. `onCPSActivationCodeAcquired`

      次を受け取ります `activationCode` セキュアプロビジョニングを開始するための。

      参照 [プロビジョニングをトリガーする](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/tokenize-a-card/trigger-provisioning.md).
   2. `onSelectIDVMethod`：エンドユーザーに表示する ID\&V メソッドを受け取ります。こちらを参照してください [ID\&V メソッドを一覧表示して選択する](#list-and-select-an-id-and-v-method).
   3. `onActivationRequired`：選択した ID\&V メソッドにアクティベーションが必要な場合（たとえば OTP）のみトリガーされます。
   4. `onComplete`：デジタル化のステップが正常に完了しました。

      ID\&V メソッドが次のいずれかの場合：

      1. **cell\_phone**, **email** または **app\_to\_app with cryptogram**：Tokenization が完了しました
      2. **website**, **customer\_service**、または **app\_to\_app without cryptogram**：Tokenization は、あなたが [CPS 通知を処理した後に完了します](/nfc-wallet-sdk-android/ja/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).

{% hint style="info" %}
次の **website**, **customer\_service**、または **app\_to\_app without cryptogram** ID\&V メソッドでは、イシュアが TSP イシュア API を使用してトークンをアクティブ化します。

この場合、プロビジョニングは、あなたが [CPS 通知を処理した後に完了します](/nfc-wallet-sdk-android/ja/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).
{% endhint %}

### ID\&V メソッドを一覧表示して選択する

次の `MGDigitizationListener.onSelectIDVMethod`、 `IDVMethodSelector` を使って利用可能な ID\&V メソッドを一覧表示します。

`IDVMethodSelector.getIdvMethodList()` は、次の配列を返します `IDVMethod` 次のフィールドを持つ：

* `id`：メソッドを選択する際にこの値を使用します。
* `type`：ID\&V の種類（たとえば、SMS による OTP、メールによる OTP、または **イシュアアプリケーションによる認証**).
* `value`：表示値。内容は `type`.
* `isOTPRequired`：SDK が `onActivationRequired`.

NFC Wallet は次の ID\&V `type` 値をサポートしています：

* **cell\_phone**

  SMS で送信された OTP を使用した ID\&V。

  使用する `value` OTP が送信されるマスク済みの電話番号を表示します。
* **email**

  メールで送信された OTP を使用した ID\&V。

  使用する `value` OTP が送信されるマスク済みのメールアドレスを表示します。
* **customer\_service**

  イシュアのカスタマーケアへの電話を使用した ID\&V。

  使用する `value` エンドユーザーが電話すべき電話番号を表示します。
* **website**

  エンドユーザーはイシュアのウェブサイトで ID\&V を完了します。

  使用する `value` ウェブサイトの URL を取得します。
* **app\_to\_app**

  この **デジタルウォレットアプリケーション** エンドユーザーを **イシュアアプリケーションによる認証**.

  使用する `value` イシュアアプリケーション名を表示します。

エンドユーザーがメソッドを選択したら、その `id` を取得して `IDVMethodSelector.select(...)` を呼び出し、NFC Wallet のバックエンドに通知します。

<pre class="language-java" data-expandable="true"><code class="lang-java">// idvMethodSelector の参照
IDVMethodSelector idvMethodSelector = null;

<strong>// インターフェース MGDigitizationListener のメソッド 
</strong><strong>@Override
</strong>public void onSelectIDVMethod(final IDVMethodSelector idvMethodSelector) {
    if (idvMethodSelector.getIdvMethodList().length == 0) {
        // エラーをログに記録
    }
    
    this.idvMethodSelector = idvMethodSelector;
    
    displayIdvMethods();
}

// 利用可能な ID&#x26;V... を表示するためのダイアログ UI を構築するメソッド
<strong>public void displayIdvMethods() {
</strong>    // ... そのため、idvMethodSelector を使用して利用可能な ID&#x26;V の一覧を表示する
    for (int i = 0; i &#x3C; idvMethodSelector.getIdvMethodList().length; i++) {
        IDVMethod idvMethod = idvMethodSelector.getIdvMethodList()[i];
        String id = idvMethod.getId();
        String type = idvMethod.getType();
        String value = idvMethod.getValue();
        boolean isOtpRequired = idvMethod.isOtpRequired();
        ...
    }
    ...
}

// エンドユーザーが ID&#x26;V メソッドを選択したときに UI から呼び出すメソッド
// 選択した idvMethod の id を指定する
public void selectIdvMethod( int idvSelectedMethodId) {
    idvMethodSelector.select( idvSelectedMethodId );
}
</code></pre>

### OTP による ID\&V

エンドユーザーが **cell\_phone** または **email**を選択すると、TSP は OTP を生成します。次に TSP はイシュアに対し、SMS またはメールで OTP を送信するよう要求します。

NFC Wallet SDK は `MGDigitizationListener.onActivationRequired` と `PendingCardActivation.getState()` の値を `OTP_NEEDED`.

あなたの **デジタルウォレットアプリケーション** に設定した場合、

OTP を入力した後、 `PendingCardActivation.activate(...)` を呼び出し、OTP を渡します。

OTP が有効であれば、SDK は `MGDigitizationListener.onComplete` コールバックをトリガーします。

{% hint style="info" %}
**OTP 入力 UI を実装する**

NFC Wallet SDK は OTP 入力 UI を提供しません。あなたの **デジタルウォレットアプリケーション**.
{% endhint %}

<pre class="language-java" data-expandable="true"><code class="lang-java">// Card Digitization listener への参照
MyDigitizationListener digitizationListener = new MyDigitizationListener();

// pending card activation の参照
PendingCardActivation pendingCardActivation = null;

<strong>// インターフェース MGDigitizationListener のメソッド 
</strong><strong>@Override
</strong>public void onActivationRequired (PendingCardActivation pendingCardActivation) {
    this.pendingCardActivation = pendingCardActivation;
    
    PendingCardActivation activationState = pendingCardActivation.getState();
    switch( activationState ) {
        case OTP_NEEDED:
            // OTP を入力する UI を表示する
            ...
    }
    ...
}

// OTP がエンドユーザーによって入力されたときに UI から呼び出すメソッド
public void idvActivationWithOtp( String otp) {
    pendingCardActivation.activate( otp.getBytes(), digitizationListener );
}
</code></pre>

### カスタマーサービスまたはウェブサービスによる ID\&V

エンドユーザーが **customer\_service** または **website**、イシュアが ID\&V を直接管理します（たとえば、イシュアのウェブポータルやイシュアのカスタマーケア経由）。

使用する `value` ウェブポータルの URL またはイシュアのカスタマーケアの電話番号を取得します。

イシュアがエンドユーザーの認証に成功した後、イシュアは TSP イシュア API を使用してトークンをアクティブ化します。

その後、NFC Wallet のバックエンドは `CPS` デジタルウォレットアプリケーションにプッシュ通知を送信します。

で説明されているようにプッシュを処理します [CPS 通知を処理する](/nfc-wallet-sdk-android/ja/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).

### App-to-app ID\&V

この ID\&V メソッドでは、デジタルウォレットアプリケーションがエンドユーザーをイシュアアプリケーションへリダイレクトします。

NFC Wallet SDK は `MGDigitizationListener.onActivationRequired` と `PendingCardActivation.getState()` の値を `APP2APP_NEEDED`.

使用する `PendingCardActivation.getAppToAppData()` を取得するために `AppToAppData` オブジェクト。

使用する `AppToAppData.getPayLoad()`, `AppToAppData.getScheme()`、および `AppToAppData.getSource()` を使用して、エンドユーザーをイシュアアプリケーションへリダイレクトします。

```java
MGCardEnrollmentService enrollmentService = MobileGatewayManager.INSTANCE.getCardEnrollmentService();
PendingCardActivation pendingCardActivation = enrollmentService.getPendingCardActivation(digitalCardId);
PendingCardActivationState state = pendingCardActivation.getState();
if (PendingCardActivationState.APP2APP_NEEDED == state) {
  AppToAppData appToAppData = pendingCardActivation.getAppToAppData();
  if(appToAppData != null) {
    String scheme = appToAppData.getScheme();
    String source = appToAppData.getSource();
    String payload = appToAppData.getPayload();
  // source を使用して packageId と intent action を取得し、イシュアアプリケーションを起動する
  }
}
```

イシュアアプリケーションが認証を完了すると、デジタルウォレットアプリケーションに戻ります。

2 つのバリエーションがあります：

* `AppToApp with cryptogram`：イシュアアプリケーションがイシュアクリプトグラムを生成します。
* `AppToApp without cryptogram`：イシュアは TSP イシュア API を使用してトークンをアクティブ化します。

〜の場合は `AppToApp with cryptogram`,

* を呼び出し `PendingCardActivation.resumeAppToAppActivation(...)` 、イシュアクリプトグラムを渡します。
* クリプトグラムが有効であれば、
  * NFC Wallet SDK は、バックグラウンドでデジタルカードプロファイルをプロビジョニングします。
  * そして SDK は `MGDigitizationListener.onComplete` コールバックをトリガーします。

〜の場合は `AppToApp without cryptogram`,

* を呼び出し `PendingCardActivation.resumeAppToAppActivation()`.
* で説明されているようにプッシュを処理します [CPS 通知を処理する](/nfc-wallet-sdk-android/ja/get-started/configuration/5.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).


---

# 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/digitize-a-card/yellow-flow-digitization.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.
