> 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/merchant-tokenization/ja/visa-ctf-to-daf/implement-ctf-and-daf/create-device-binding-yellow-flow/activate-binding-with-customer-service.md).

# カスタマーサービスでバインディングを有効化

カスタマーサービスは次のように使用されます **ID\&V** 保留中のデバイスバインディングを有効化するための手法。

このページは次のフローの続きです [デバイスバインディングを作成する（黄色のフロー）](/merchant-tokenization/ja/visa-ctf-to-daf/implement-ctf-and-daf/create-device-binding-yellow-flow.md).

前提条件：

* あなたは既に開始しています `createBinding` または `resumeBinding`.
* イシュアが選択しました `CUSTOMER_SERVICE` をID\&V手段として。
* あなたのマーチャントアプリはエンドユーザーをカスタマーサービスに案内できます。

## フロー

<figure><img src="/files/a0858486c9aef11be3f43cc43a6c68dc85eab157" alt=""><figcaption><p>カスタマーサービスによるデバイスバインディングフロー。</p></figcaption></figure>

<table><thead><tr><th width="100">ステップ</th><th>説明</th></tr></thead><tbody><tr><td>1</td><td>エンドユーザーがマーチャントアプリでカスタマーサービスオプションを選択します。</td></tr><tr><td>2</td><td>マーチャントアプリは選択内容をThalesバックエンドに転送します。</td></tr><tr><td>3</td><td>エンドユーザーはイシュアに連絡して認証し、デバイスバインディング要求を確認します。</td></tr><tr><td>4</td><td>イシュアはデバイスバインディング要求を受け入れ、通知します <strong>VTS</strong>.</td></tr><tr><td>5–6</td><td>VTSはThalesバックエンドに通知し、Thalesはマーチャント/PSPバックエンドに通知します。</td></tr><tr><td>7</td><td>マーチャント/PSPバックエンドは結果をマーチャントアプリに伝えます。</td></tr><tr><td>8</td><td>マーチャントアプリはThales SDK内でローカルにバインディングを有効化します。</td></tr></tbody></table>

{% hint style="info" %}
カスタマーサービスフローでは、マーチャントアプリがデバイスバインディングを開始します。最終的な承認はサーバー側から行われます。

デバイスとサーバーの非同期状態の可能性に対処してください。成功ステータスを受け取ってからのみローカルでバインディングを有効化してください。
{% endhint %}

## SDK統合

### 1. カスタマーサービスのID\&V手段を選択する

の間に `createBinding` または `resumeBinding`を送信します `カスタマーサービス` をID\&V手段として。

{% tabs %}
{% tab title="Android" %}
送信が成功すると、SDKは次を呼び出します `onIssuerAuthenticationReady`。失敗した場合、SDKは次を呼び出します `onError`.

```java
@Override
public void onIssuerAuthenticationRequired(IDVSession idvSession) { 
    // CUSTOMER_SERVICE の ID&V メソッドを送信する
    for (IDVMethod idvMethod : idvSession.getIdvMethods()) {
        if (idvMethod.getType().equals(IDVType.CUSTOMER_SERVICE)) {
            idvSession.selectIdvMethod(idvMethod);
        }
    }
}

@Override
public void onIssuerAuthenticationReady(IDVSession idvSession, 
                                        @Nullable OtpActivationStatus status) {
    
}

@Override
public void onError(TMGClientException exception) { 
    // エラーがあるか確認する
    int errorCode = exception.getErrorCode();
    int errorMessage = exception.getMessage();
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
guard let idvSession = VisaService.shared.idvSession else {
    // idv セッションがありません
    return
}
// 1. IDV 手段の一覧を表示する
do {
    let idvMethods = try idvSession.idvMethods
    let selectedIdvMethod = idvMethods[0] // ユーザーが CUSTOMER_SERVICE の idv メソッドを選択する
    
    // 2. IDV メソッドを送信する。
    idvSession.selectIDVMethod(selectedIdvMethod) { (result) in
        if let otpActivationStatus = result {
        
        } else {
            if selectedIdvMethod.type == .customerService {
                let value = selectedIdvMethod.value
                // 3. カスタマーサービスを通じて確認する。
            }
        }
    }
} catch let error {
    // エラーを処理する。
}

// 4. ステップ2（selectIDVMethod）の失敗は completionHandler で処理されます。
VisaService.shared.completionHandler = { (session, error) in
    // 5. それが selectIDVMethod のエラーか確認する。
    if let session = session,
        let error = error,
        error.description == TMGError.invalidIdvMethod.description {
        VisaService.shared.idvSession = session
        // 6. IDV フローを再試行する。
    }
}
```

{% endtab %}
{% endtabs %}

### 2. カスタマーサービスのデータを取得する

を使用して `IDVMethod.value` イシュアが返したカスタマーサービス情報を表示します。

{% tabs %}
{% tab title="Android" %}
トークン有効化に必要なデータは、から取得できます `IDVMethod` オブジェクト。

```java
// カスタマーサービスのデータを取得する
String value = idvMethod.getValue();
```

{% endtab %}

{% tab title="iOS" %}

```swift
let value = selectedIdvMethod.value
```

{% endtab %}
{% endtabs %}

### 3. バインディングを有効化する

成功の確認を受け取ったら、次を呼び出してバインディングを有効化します `activateBinding` に対して `IDVSession`.

次を渡します `null` （Android）または `nil` （iOS）を渡して、カスタマーサービスでの検証が完了したことを確認します。

{% tabs %}
{% tab title="Android" %}

```java
@Override
public void onIssuerAuthenticationReady(IDVSession idvSession, 
                                        @Nullable OtpActivationStatus status) { 
    // ローカルでバインディングを有効化する
    idvSession.activateBinding(null);
}

@Override
public void onError(TMGClientException exception) { 
    // エラーがあるか確認する
    int errorCode = exception.getErrorCode();
    int errorMessage = exception.getMessage();
}
```

結果は次を介して返されます `onSuccess` または `onError`.
{% endtab %}

{% tab title="iOS" %}

```swift
guard let idvSession = VisaService.shared.idvSession else {
    // idv セッションがありません
    return
}
// 1. activate を呼び出す
idvSession.activateBinding(withValue: nil)

VisaService.shared.completionHandler = { (session, error) in
    // 2. バインディング成功
    if error == nil {
        
    }
}
```

結果は次に返されます `completionHandler`.

有効化に失敗した場合、 `completionHandler` はを返します `IDVSession` および再試行のためのエラー。
{% endtab %}
{% endtabs %}


---

# 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/merchant-tokenization/ja/visa-ctf-to-daf/implement-ctf-and-daf/create-device-binding-yellow-flow/activate-binding-with-customer-service.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.
