> 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ウォレット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/156684fd60ec0f75b8b6525dfe7388d60a444995" 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ウォレットSDKは以下を発行します `digitizationApprovedWithIDV`.
3. 発行元がサポートするID\&V方式を取得するには、次を使用します `IDVMethodSelector.getIDVMethodList()`.
4. 方式を表示してエンドユーザーに選択させます。
5. IDVMethodSelector.select(idvID:) を呼び出して NFC ウォレット SDK に通知します `IDVMethodSelector.select(idvID:)`.

### サポートされているID\&V方式

NFCウォレットSDKは次のID\&V方式をサポートしています：

* `otpBySMS`：SMSで送信されるワンタイムパスワード（OTP）でエンドユーザーを検証します。
* `otpByEmail`：メールで送信されるワンタイムパスワード（OTP）でエンドユーザーを検証します。
* `customerService`：イシュアのカスタマーサポートを通じてエンドユーザーを検証します。
* `webService`：イシュアのウェブサイト上でエンドユーザーを検証します。
* `appToApp`：イシュアのアプリ内でエンドユーザーを検証します。
  * `with cryptogram`：イシュアアプリがイシュア暗号文（issuer cryptogram）を生成します。
  * `without cryptogram`：イシュアが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 {
    /// 表示するために方式を一覧表示する
}

// ... ウォレットが選択されたID&V方式を取得するためのコード ...

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

{% endcode %}

### OTPによるID\&V

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

NFCウォレットSDKは以下を発行します `activationRequired` とともに `PendingCardActivation.State` に設定される `otpNeeded`.

エンドユーザーがOTPを入力した後、次を呼び出します `PendingCardActivation.activate()` とOTPの値を渡します。

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

{% hint style="info" %}
**OTP入力UIの実装**

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

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

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

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

発行元がエンドユーザーを正常に認証した後、発行元はTSPイシュアAPIを使用してトークンを有効化します。

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

プッシュの処理方法は、次に示すとおりです [CPS通知の処理](/nfc-wallet-sdk-ios/ja/get-started/configuration/4.-push-notifications/handle-push-notifications.md#process-cps-notifications-digital-card-operations).

### アプリ間（App-to-app）ID\&V

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

NFCウォレットSDKは以下を発行します `activationRequired` とともに `PendingCardActivation.State` に設定される `appToAppSelected`.

使用する `appToAppSelected.requestPayload`, `appToAppSelected.scheme`、および `appToAppSelected.source` を使用してエンドユーザーをイシュアアプリにリダイレクトします。

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

アプリ間ID\&V方式はMastercardおよびVisaでサポートされています。詳細はMastercardまたはVisaの仕様を参照してください。
{% endhint %}

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

2つの可能な方法があります：

* `暗号文付きのAppToApp`：イシュアアプリがイシュア暗号文（issuer cryptogram）を生成します。
* `暗号文なしのAppToApp`：イシュアがTSPイシュアAPIを使用してトークンを有効化します。

については、 `暗号文付きのAppToApp`を呼び出します `PendingCardActivation.resumeAppToAppActivation(withTAV:)` およびイシュア暗号文を提供します。NFCウォレットSDKはバックグラウンドでデジタルカードプロファイルをプロビジョニングします。プロビジョニングが完了すると、NFCウォレットSDKは以下を発行します `activatedByIDV`.

については、 `暗号文なしのAppToApp`を呼び出します `PendingCardActivation.resumeAppToAppActivation()`。その後、NFCウォレットバックエンドはデジタルウォレットアプリにプッシュ通知を送信します。プッシュの処理方法は次に示すとおりです `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 `appToApp with cryptogram`.


---

# 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.
