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

# ODA 証明書を更新する

## 概要

オフラインデータ認証（ODA）は、Visaの非接触決済中にODA証明書を使用する場合があります。

支払いの中断を避けるため、ODA証明書は有効期限が切れる前に更新してください。

{% hint style="info" %}
NFC Wallet SDK は、Visa の ODA 証明書更新のみをサポートしています。
{% endhint %}

## SDK統合

### 更新が必要かどうかを確認する

使用する `DigitalCard` デジタルカードがODAをサポートしているか、およびその証明書が期限切れかどうかを確認するには：

* `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 }

// 証明書を更新する。
```

この確認を行います：

* 後 **NFC Wallet SDK** の初期化。
* 支払い後。
* カードがデフォルトに設定されたとき。
* 接続が回復した後（オフライン→オンライン）。

### ODA証明書を更新する

使用する `ODARenewalService` Visa デジタルカードの ODA 証明書を更新するには：

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

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

エンドユーザー体験を向上させるため、予測可能なタイミングで更新を開始してください：

* 既定のカードが設定された後。
* 支払いが完了した後。

{% hint style="info" %}
`renewIfNeeded()` 両方を確認します `digitalCard.isODASupported` と `digitalCard.needsODARenewal`.

個別の事前確認なしで直接呼び出せます。
{% endhint %}

{% hint style="warning" %}
`renewIfNeeded()` 以下の場合は何もしません：

* この `digitalCard` Visaカードではない。
* `digitalCard.isODASupported` が `false`.
* `digitalCard.needsODARenewal` が `false`.

設定する `isForced` を `true` 次の場合でも更新するには `digitalCard.needsODARenewal` が `false`:

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

のデフォルト値は `isForced` が `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, and the optional `goal` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-ios/ja/implement-nfc-wallet/make-payments/renew-oda-certificates.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.
