> 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/pin-management/es/implementar-la-gestion-de-pin/mostrar-un-pin.md).

# Mostrar un PIN

Esta sección describe cómo mostrar el PIN de la tarjeta de forma segura.

D1 actualmente admite **bloque PIN ISO 0** devuelto por el **backend del emisor**.

### Experiencia del usuario

<figure><img src="https://1922569835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEzl7yJruGtpgrpgTXEjo%2Fuploads%2FJABCNTXz2qgJi6i89330%2FUX%20-%20Display%20card%20details.svg?alt=media&amp;token=48b31d2a-f832-42e1-967c-216291de1895" alt=""><figcaption><p>Pantalla de ejemplo para mostrar el PIN en la aplicación del emisor</p></figcaption></figure>

### Flujo

<figure><img src="https://1922569835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEzl7yJruGtpgrpgTXEjo%2Fuploads%2FXLR5xIpcW32hAqJitcpD%2FFlow%20-%20PIN%20Management%20-%20%20Display%20a%20PIN.svg?alt=media&amp;token=dd159ca4-bdcf-4afc-8d30-c23156979175" alt=""><figcaption><p>Flujo de alto nivel para mostrar un PIN</p></figcaption></figure>

1. **Usuario final** se autentica en la **aplicación del emisor** y solicita el PIN.
2. La aplicación del emisor llama al método de visualización de PIN del SDK de D1.
3. El SDK de D1 llama al **backend de D1** API “Obtener PIN”.
4. El backend de D1 solicita el bloque PIN al **backend del emisor** (D1 no almacena PINs).
5. backend de D1 **transcifra** el bloque PIN desde las claves del emisor a las claves del dispositivo.
6. El SDK muestra el PIN en una interfaz segura durante un tiempo limitado.

### Diagrama de secuencia

#### Pre-requisitos

* Usuario final, cuenta y tarjeta ya registrados en D1
* El SDK está correctamente inicializado
* La aplicación del emisor llamó a la API de inicio de sesión del SDK de D1.
* El backend del emisor expone el endpoint “Obtener PIN” y devuelve **bloque PIN ISO 0**.

<figure><img src="https://1922569835-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEzl7yJruGtpgrpgTXEjo%2Fuploads%2FGt8cYweUgXQzqhXyde0d%2FSequence%20Diagram%20-%20PIN%20Management%20-%20%20Display%20a%20PIN.svg?alt=media&amp;token=55c62d29-9114-4d51-a09f-037fc70953db" alt=""><figcaption><p>Diagrama de secuencia para la visualización del PIN</p></figcaption></figure>

`CardPINUI` contiene `PINDisplayTextView` (Android) y `D1PINDisplayTextField` (iOS), que heredan del [TextView](https://developer.android.com/reference/android/widget/TextView) y [UITextField](https://developer.apple.com/documentation/uikit/uitextfield). La configuración del campo de texto (fuente, tamaño, color) puede hacerse usando las propiedades de estos objetos nativos.

### Seguridad y cumplimiento

* La visualización del PIN ocurre en una interfaz segura y resistente a manipulaciones.
* Los datos del PIN no se persisten en el dispositivo.
* El intercambio de datos está cifrado de extremo a extremo.
* La solución está diseñada para cumplir con PCI DSS en el manejo de PIN.

### APIs requeridas

| API                                                                                                                                                                                                              | Entrada/Salida      | Descripción                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- | ------------------------------------------------------------------- |
| [Obtener PIN](https://docs.payments.thalescloud.io/pin-management/es/integrar-la-api-d1/referencia-de-la-api-d1/api-saliente-desde-d1/api-de-gestion-de-pin.md#get-cms-api-v1-issuers-issuerid-cards-cardid-pin) | Emisor <- Thales D1 | Recuperar el PIN del backend del emisor para mostrarlo en el móvil. |

### SDK

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

```java
PINDisplayTextView pinDisplayTextView = <Objeto de tipo PINDisplayTextView>;
CardPINUI ui = new CardPINUI(pinDisplayTextView);
String cardID = "<ID de la tarjeta>";

d1Task.displayPhysicalCardPIN(cardID, ui, new D1Task.Callback<Void>() {
    @Override
    public void onSuccess(Void data) {
        // Continúe con los flujos posteriores, el PIN ahora se está mostrando en la vista de texto proporcionada.
    }
    
    @Override
    public void onError(D1Exception exception) {
        // Consulte la sección Integración del SDK D1 – Gestión de errores
    }
});
```

{% endtab %}

{% tab title="iOS" %}

```swift
let displayTextField = <Objeto de tipo D1PINDisplayTextField>
let cardPINUI = CardPINUI(pinTextField: displayTextField)
let cardID = <ID de la tarjeta>

d1Task.displayPhysicalCardPIN(cardID, cardPINUI: cardPINUI) { error in
    if let error = error {
        // Consulte la sección Integración del SDK D1 – Gestión de errores
    } else {
        // Continúe con los flujos posteriores, el PIN ahora se está mostrando en el campo de texto proporcionado.
    }
}En
```

{% 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.payments.thalescloud.io/pin-management/es/implementar-la-gestion-de-pin/mostrar-un-pin.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
