> 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-android/es/implement-nfc-wallet/manage-digital-cards/set-the-default-payment-card.md).

# Establecer la tarjeta de pago predeterminada

## Resumen

La tarjeta digital predeterminada es la tarjeta que su **aplicación de billetera digital** selecciona automáticamente para pagos sin contacto.

El **usuario final** puede mantener la tarjeta digital predeterminada o cambiar de tarjeta en su interfaz antes de confirmar el pago.

Ver [Implementar pagos sin contacto](/nfc-wallet-sdk-android/es/implement-nfc-wallet/make-payment/implement-contactless-payments.md).

## Integración del SDK

### Establecer la tarjeta de pago predeterminada

Llame a `DigitalizedCard.setDefault()` en la `DigitalizedCard` que desea establecer como predeterminada.

{% hint style="warning" %}
Antes de establecer una tarjeta digital como predeterminada, confirme que esté activa y tenga al menos un pago restante (clave de pago). Use los campos de estado de la tarjeta y estado de la clave de pago en [Mostrar tarjetas digitales](/nfc-wallet-sdk-android/es/implement-nfc-wallet/manage-digital-cards/display-digital-cards.md#retrieve-digital-card-information) para validar ambos.

* Llame a `DigitalizedCardStatus.getState()` para verificar el estado de la tarjeta.
* Llame a `DigitalizedCardStatus.getNumberOfPaymentsLeft()` para comprobar los pagos restantes.
  {% endhint %}

El ejemplo a continuación establece la tarjeta digital predeterminada para pagos sin contacto.

{% code title="SetDefaultCard.java" %}

```java
public void setDefault(final DigitalizedCard digitalizedCard) {
    digitalizedCard.setDefault(
        PaymentType.CONTACTLESS,
        new AsyncHandlerVoid(new AsyncHandlerVoid.Delegate() {
            @Override
            public void onSuccess() {
                // Tarjeta predeterminada establecida con éxito.
            }

            @Override
            public void onError(final String error) {
                // TODO: manejar el error
            }
        })
    );
}
```

{% endcode %}

### `DigitalizedCardManager` para la gestión de la tarjeta predeterminada

`DigitalizedCardManager` proporciona APIs adicionales para la gestión de la tarjeta predeterminada:

* `DigitalizedCardManager.getDefault()`: Recuperar el **ID de la tarjeta tokenizada** de la tarjeta predeterminada.
* `DigitalizedCardManager.unsetDefaultCard()`: Anular la tarjeta predeterminada actual. Después de eso, no hay ninguna tarjeta seleccionada por defecto.


---

# 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-android/es/implement-nfc-wallet/manage-digital-cards/set-the-default-payment-card.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.
