> 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-ios/ja/implement-nfc-wallet/tokenize-a-card/digitize-card/yellow-flow-digitization.md).

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

## 概要

黄色フローは、イシュアのバックエンドがステップアップ認証（ID\&V）を使用してトークナイゼーションを承認するトークナイゼーションフローです。

このフローは、NFC Wallet SDK が複数のイシュア向けにカードをトークン化するデジタルウォレットアプリに統合されている場合によく見られます。

この場合、ソリューションはトークナイゼーションを完了するために ID\&V を使用して認証する必要があります。

## ユーザー体験

参照 [黄色フローのユーザー体験](/nfc-wallet-sdk-ios/ja/implement-nfc-wallet/tokenize-a-card.md#yellow-flow).

## シーケンス図

<figure><img src="/files/a7b2ec2d4f0a454c41233eaeb3c9f04d2e94c786" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/57908c7ff301c81582f41b930d82e736ae9e461f" alt=""><figcaption><p>黄色フロー: の後に ID&#x26;V メソッドを選択 <code>digitizationApprovedWithIDV</code>.</p></figcaption></figure>

## SDK を統合する

その後 [カードの有効性を確認する](/nfc-wallet-sdk-ios/ja/implement-nfc-wallet/tokenize-a-card/check-card-eligibility.md):

1. 次を呼び出します `CardDigitizationService.digitizeCard()`.
2. トークナイゼーションが条件付きで承認された場合（黄色フロー）:
   * NFC Wallet SDK は次を発行します `digitizationApprovedWithIDV`.
3. を使用してイシュア対応の ID\&V メソッドを取得します `IDVMethodSelector.getIDVMethodList()`.
4. メソッドを表示し、エンドユーザーに 1 つ選択させます。
5. 次を呼び出して NFC Wallet SDK に通知します `IDVMethodSelector.select(idvID:)`.

### 対応する ID\&V メソッド

NFC Wallet SDK は次の ID\&V メソッドをサポートしています:

* `otpBySMS`: SMS で送信されたワンタイムパスワード（OTP）を使用してエンドユーザーを認証します。
* `otpByEmail`: メールで送信されたワンタイムパスワード（OTP）を使用してエンドユーザーを認証します。
* `customerService`: イシュアのカスタマーケアを通じてエンドユーザーを認証します。
* `webService`: イシュアの Web サイトでエンドユーザーを認証します。
* `appToApp`: イシュアアプリケーションでエンドユーザーを認証します。
  * `暗号値あり`: イシュアアプリケーションがイシュアの暗号値を生成します。
  * `暗号値なし`: イシュアが TSP イシュア API を使用してトークンを有効化します。

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

次の例を使用して、イシュア対応の ID\&V メソッドを一覧表示します。

```swift
func digitizeCard(_ termsAndConditions: CardDigitizationService.TermsAndConditions) async throws {
    // 手順 1: カードデジタル化サービスを初期化します。
    let cardDigitizationService = CardDigitizationService()
    let fcmToken: String = "FACY6074293608087656831WRF1234" // 例のみ。

    // 手順 2: カードデジタル化プロセスを開始します。
    try await cardDigitizationService.digitizeCard(withTNC: termsAndConditions.accept(),
                                                  pushToken: fcmToken,
                                                  language: "en")

    // 手順 3: デジタル化イベントを購読します。
    for await state in await cardDigitizationService.eventStream {
        switch state {
        case let .digitizationApprovedWithIDV(_, idvMethodSelector):
            // 黄色フロー: イシュア対応の ID&V メソッドを一覧表示します。
            let verificationMethods = idvMethodSelector.getIDVMethodList()
            for method in verificationMethods {
                if method.type == .otpBySMS || method.type == .otpByEmail {
                    /// OTP メソッド。
                } else if method.type == .webService || method.type == .customerService {
                    /// イシュアによって直接処理されるメソッド。
                } else if method.type == .appToApp {
                    /// イシュアアプリケーションを使用するアプリ間メソッド。
                }
            }

        default:
            break
        }
    }
}
```

使用する `IDVMethod.id` を呼び出すときに `IDVMethodSelector.select(idvID:)`.

{% code title="ID\&V メソッドを選択" %}

```swift
case let .digitizationApprovedWithIDV(digitalCardID, idvMethodSelector):

let verificationMethods = idvMethodSelector.getIDVMethodList()
for method in verificationMethods {
    /// 表示するメソッドを一覧化します
}

// ... code for wallet to capture the selected ID&V method ...

// メソッド ID を使用してメソッドを選択します
try await idvMethodSelector.select(idvID: selectedMethod.id)
```

{% endcode %}

### OTP による ID\&V

エンドユーザーが次を選択した場合 `otpBySMS` または `otpByEmail`、TSP が OTP を生成します。その後、TSP はイシュアに対し、SMS またはメールで OTP を送信するよう要求します。

NFC Wallet SDK は次を発行します `activationRequired` で `PendingCardActivation.State` に設定される `otpNeeded`.

エンドユーザーが OTP を入力したら、次を呼び出します `PendingCardActivation.activate()` OTP 値を使用して。

NFC Wallet SDK はバックグラウンドでデジタルカードプロファイルをプロビジョニングします。プロビジョニングが完了すると、NFC Wallet SDK は次を発行します `activatedByIDV`.

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

NFC Wallet SDK は OTP 入力 UI を提供しません。デジタルウォレットアプリで OTP UI を実装し、カスタマイズしてください。
{% endhint %}

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

デジタルウォレットアプリケーションが次を選択した場合 `webService` または `customerService`、イシュアが ID\&V を直接管理します。これはイシュアの Web ポータルまたはイシュアのカスタマーケアを通じて行われます。

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

イシュアがエンドユーザーの認証に成功すると、イシュアは TSP イシュア API を使用してトークンを有効化します。

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

次の説明に従ってプッシュを処理します [CPS 通知を処理する](/nfc-wallet-sdk-ios/ja/get-started/configuration/4.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).

### アプリ間 ID\&V

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

NFC Wallet SDK は次を発行します `activationRequired` で `PendingCardActivation.State` に設定される `appToAppSelected`.

使用する `appToAppSelected.requestPayload`, `appToAppSelected.scheme`、および `appToAppSelected.source` エンドユーザーをイシュアアプリケーションへリダイレクトするために

{% hint style="info" %}
**イシュアアプリケーションへリダイレクトする**

このアプリ間 ID\&V メソッドは Mastercard と Visa でサポートされています。詳細は Mastercard または Visa の仕様を参照してください。
{% endhint %}

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

可能なメソッドは 2 つあります:

* `暗号値ありの AppToApp`: イシュアアプリケーションがイシュアの暗号値を生成します。
* `暗号値なしの AppToApp`: イシュアが TSP イシュア API を使用してトークンを有効化します。

次の場合 `暗号値ありの AppToApp`、次を呼び出します `PendingCardActivation.resumeAppToAppActivation(withTAV:)` 、イシュアの暗号値を指定します。NFC Wallet SDK はバックグラウンドでデジタルカードプロファイルをプロビジョニングします。プロビジョニングが完了すると、NFC Wallet SDK は次を発行します `activatedByIDV`.

次の場合 `暗号値なしの AppToApp`、次を呼び出します `PendingCardActivation.resumeAppToAppActivation()`。その後、NFC Wallet バックエンドは次を送信します `CPS` デジタルウォレットアプリケーションへのプッシュ通知。次の説明に従ってプッシュを処理します [CPS 通知を処理する](/nfc-wallet-sdk-ios/ja/get-started/configuration/4.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).

### アクティベーションを再開する

ID\&V プロセスが中断された場合は、次を使用して再開します `PendingCardActivationSession` API。

これにより、エンドユーザーは ID\&V メソッドを再選択できます: `otpBySMS`, `otpByEmail`, `customerService`, `webService`、または `暗号値ありの appToApp`.


---

# 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-ios/ja/implement-nfc-wallet/tokenize-a-card/digitize-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.
