> 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/es/ctf-y-daf-de-visa/implement-ctf-and-daf/create-device-binding-yellow-flow/activate-binding-with-customer-service.md).

# Activar la vinculación con atención al cliente

El servicio de atención al cliente se utiliza como el **ID\&V** método para activar un enlace de dispositivo pendiente.

Esta página continúa el flujo después de [Crear enlace de dispositivo (flujo amarillo)](/merchant-tokenization/es/ctf-y-daf-de-visa/implement-ctf-and-daf/create-device-binding-yellow-flow.md).

Prerequisitos:

* Ya has iniciado `createBinding` o `resumeBinding`.
* El emisor seleccionó `CUSTOMER_SERVICE` como el método de ID\&V.
* Tu aplicación del comerciante puede dirigir al usuario final al servicio de atención al cliente.

## Flujo

<figure><img src="/files/87b64bb8a9bd63041ed0503c1f201d3d723571a7" alt=""><figcaption><p>Flujo de enlace de dispositivo por servicio de atención al cliente.</p></figcaption></figure>

<table><thead><tr><th width="100">Paso</th><th>Descripción</th></tr></thead><tbody><tr><td>1</td><td>El usuario final selecciona la opción de servicio de atención al cliente en la aplicación del comerciante.</td></tr><tr><td>2</td><td>La aplicación del comerciante reenvía la selección al backend de Thales.</td></tr><tr><td>3</td><td>El usuario final contacta con el emisor para autenticarse y confirmar la solicitud de enlace de dispositivo.</td></tr><tr><td>4</td><td>El emisor acepta la solicitud de enlace de dispositivo e informa a <strong>VTS</strong>.</td></tr><tr><td>5–6</td><td>VTS notifica al backend de Thales, que notifica al backend del comerciante/PSP.</td></tr><tr><td>7</td><td>El backend del comerciante/PSP comunica el resultado a la aplicación del comerciante.</td></tr><tr><td>8</td><td>La aplicación del comerciante activa el enlace localmente en el SDK de Thales.</td></tr></tbody></table>

{% hint style="info" %}
En el flujo de servicio de atención al cliente, la aplicación del comerciante inicia el enlace de dispositivo. La aprobación final proviene del lado del servidor.

Gestiona la posible desincronización dispositivo/servidor. Solo activa el enlace localmente después de recibir un estado exitoso.
{% endhint %}

## Integración del SDK

### 1. Selecciona el método de ID\&V de servicio de atención al cliente

Durante `createBinding` o `resumeBinding`, envía `Servicio de atención al cliente` como el método de ID\&V.

{% tabs %}
{% tab title="Android" %}
Si el envío tiene éxito, el SDK llama a `onIssuerAuthenticationReady`. Si falla, el SDK llama a `onError`.

```java
@Override
public void onIssuerAuthenticationRequired(IDVSession idvSession) { 
    // Enviar método ID&V CUSTOMER_SERVICE
    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) { 
    // Comprueba si hay algún error
    int errorCode = exception.getErrorCode();
    int errorMessage = exception.getMessage();
}
```

{% endtab %}

{% tab title="iOS" %}

```swift
guard let idvSession = VisaService.shared.idvSession else {
    // no hay sesión idv
    return
}
// 1. Muestra la lista de métodos de IDV
do {
    let idvMethods = try idvSession.idvMethods
    let selectedIdvMethod = idvMethods[0] // el usuario selecciona un método idv CUSTOMER_SERVICE
    
    // 2. Enviar el método IDV.
    idvSession.selectIDVMethod(selectedIdvMethod) { (result) in
        if let otpActivationStatus = result {
        
        } else {
            if selectedIdvMethod.type == .customerService {
                let value = selectedIdvMethod.value
                // 3. Verificar a través del servicio de atención al cliente.
            }
        }
    }
} catch let error {
    // Maneja el error.
}

// 4. El fallo en el paso 2, selectIDVMethod, se manejará en completionHandler.
VisaService.shared.completionHandler = { (session, error) in
    // 5. Comprueba si es un error de selectIDVMethod.
    if let session = session,
        let error = error,
        error.description == TMGError.invalidIdvMethod.description {
        VisaService.shared.idvSession = session
        // 6. Reinicia el flujo de IDV.
    }
}
```

{% endtab %}
{% endtabs %}

### 2. Obtener datos del servicio de atención al cliente

Usa el `IDVMethod.value` para mostrar la información del servicio de atención al cliente devuelta por el emisor.

{% tabs %}
{% tab title="Android" %}
Los datos necesarios para la activación del token se pueden recuperar desde el `IDVMethod` objeto.

```java
// Obtener los datos del servicio de atención al cliente
String value = idvMethod.getValue();
```

{% endtab %}

{% tab title="iOS" %}

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

{% endtab %}
{% endtabs %}

### 3. Activar el enlace

Después de recibir una confirmación exitosa, activa el enlace llamando a `activateBinding` en el `IDVSession`.

Pasa `null` (Android) o `nil` (iOS) para confirmar que la verificación por servicio de atención al cliente está completa.

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

```java
@Override
public void onIssuerAuthenticationReady(IDVSession idvSession, 
                                        @Nullable OtpActivationStatus status) { 
    // Activar el enlace localmente
    idvSession.activateBinding(null);
}

@Override
public void onError(TMGClientException exception) { 
    // Comprueba si hay algún error
    int errorCode = exception.getErrorCode();
    int errorMessage = exception.getMessage();
}
```

El resultado se devuelve mediante `onSuccess` o `onError`.
{% endtab %}

{% tab title="iOS" %}

```swift
guard let idvSession = VisaService.shared.idvSession else {
    // no hay sesión idv
    return
}
// 1. Llama a activate
idvSession.activateBinding(withValue: nil)

VisaService.shared.completionHandler = { (session, error) in
    // 2. Enlace exitoso
    if error == nil {
        
    }
}
```

El resultado se devuelve en `completionHandler`.

Si la activación falla, `completionHandler` devuelve un `IDVSession` y un error para reintentar.
{% 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/es/ctf-y-daf-de-visa/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.
