> 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/implement-nfc-wallet/make-payments/renew-oda-certificates.md).

# Renew ODA certificates

## Overview

Offline Data Authentication (ODA) may be use an ODA certificate during a Visa contactless payment.

To avoid payment interruptions, renew the ODA certificate before it expires.

{% hint style="info" %}
The NFC Wallet SDK supports ODA certificate renewal for Visa only.
{% endhint %}

## SDK Integration

### Check whether renewal is needed

Use `DigitalCard` to check whether a digital card supports ODA and whether its certificate is expired:

* `DigitalCard.isODASupported: Bool`
* `DigitalCard.needsODARenewal: Bool`

```swift
guard let digitalCard = await digitalCardManager.digitalCard(forID: digitalCardID) else { return }
let isODASupported = await digitalCard.isODASupported
let needsODARenewal = await digitalCard.needsODARenewal

guard isODASupported else { return }
guard needsODARenewal else { return }

// Renew the certificate.
```

Perform this check:

* After **NFC Wallet SDK** initialization.
* After a payment.
* When the card is set as default.
* After connectivity returns (offline → online).

### Renew the ODA certificate

Use `ODARenewalService` to renew a Visa digital card ODA certificate:

* `ODARenewalService.renewIfNeeded(digitalCardID: String, isForced: Bool)`

```swift
try await odaRenewalService.renewIfNeeded(digitalCardID: digitalCard.digitalCardID)
```

To improve the end user experience, trigger renewal at predictable moments:

* After the default card is set.
* After a payment has been completed.

{% hint style="info" %}
`renewIfNeeded()` checks both `digitalCard.isODASupported` and `digitalCard.needsODARenewal`.

You can call it directly without a separate pre-check.
{% endhint %}

{% hint style="warning" %}
`renewIfNeeded()` is a no-op if:

* The `digitalCard` is not a Visa card.
* `digitalCard.isODASupported` is `false`.
* `digitalCard.needsODARenewal` is `false`.

Set `isForced` to `true` to renew even when `digitalCard.needsODARenewal` is `false`:

```swift
try await odaRenewalService.renewIfNeeded(
    digitalCardID: digitalCard.digitalCardID,
    isForced: true
)
```

The default value for `isForced` is `false`.
{% endhint %}


---

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

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/implement-nfc-wallet/make-payments/renew-oda-certificates.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
