> 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ウォレット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ウォレット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` がfalseのときでも更新するために `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:

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