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

# ODA証明書を更新する

### 概要

Visaの非接触決済では、オフラインデータ認証（ODA）を使用できます。

各Visaデジタルカードには、有効期限付きのODA証明書が含まれています。決済の中断を避けるため、期限切れになる前に証明書を更新してください。

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

### SDK 連携

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

デジタルカードがVisa ODAをサポートしているか、また証明書の有効期限が切れているかを確認するには、取得して `DigitalizedCardDetails` および次を呼び出します：

* `DigitalizedCardDetails.isVisaODASupported()`
* `DigitalizedCardDetails.isVisaODACertificateExpired()`

次を使用します: **トークン化カード ID** をカード識別子として使用します。詳細は [デジタルカードを表示する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/display-digital-cards.md#tokenized-card-id-versus-digital-card-id).

```java
String tokenizedCardId = "...";

DigitalizedCard card =
        DigitalizedCardManager.getDigitalizedCard(tokenizedCardId);

card.getCardDetails(new AbstractAsyncHandler<DigitalizedCardDetails>() {
    
    @Override
    public void onComplete(AsyncResult<DigitalizedCardDetails> result) {
        if (!result.isSuccessful()) {
            // エラーを処理します。
            return;
        }

        DigitalizedCardDetails details = result.getResult();

        // 決済スキームを確認します。
        if (!"VISA".equalsIgnoreCase(details.getScheme())) {
            return;
        }

        // 必要な場合にのみ更新を要求します。
        if (details.isVisaODASupported() && details.isVisaODACertificateExpired()) {
            // ODA証明書の更新を要求します。
        }
    }
});
```

この確認を行うタイミング：

* の後、 **NFC Wallet SDK** の初期化。
* 決済後。
* カードがデフォルトとして設定された後。
* 接続が復帰した後（オフライン -> オンライン）。

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

呼び出します `ProvisioningBusinessService.sendRequestForODACertificateRenewal(...)` を使用して、VisaデジタルカードのODA証明書更新を要求します。

1. カード識別子を取得します。

   次を使用します: **トークン化カード ID**。参照してください [デジタルカードを表示する](/nfc-wallet-sdk-android/ja/implement-nfc-wallet/manage-digital-cards/display-digital-cards.md#tokenized-card-id-versus-digital-card-id).
2. ODA証明書の更新要求を送信します。

   呼び出します `sendRequestForODACertificateRenewal(...)` および実装します `PushServiceListener`:

   * `onComplete`: SDKが要求を正常に送信します。
   * `onError`: SDK はリクエストを送信できません。確認してください `ProvisioningServiceError`.

```java
String tokenizedCardId = "...";

ProvisioningBusinessService provisioningService =
        ProvisioningServiceManager.getProvisioningBusinessService();

provisioningService.sendRequestForODACertificateRenewal(
        tokenizedCardId,
        new PushServiceListener() {

            @Override
            public void onComplete() {
                // 要求は正常に送信されました。
                // NFC Walletバックエンドからのプッシュ通知を期待します。
            }

            @Override
            public void onUnsupportedPushContent(Bundle bundle) {
                // Visa ODA証明書の更新では使用されません。
            }

            @Override
            public void onServerMessage(String tokenizedCardId,
                                        ProvisioningServiceMessage message) {
                // オプション：NFC Walletバックエンドからのステータスメッセージを処理します。
            }

            @Override
            public void onError(ProvisioningServiceError error) {
                // エラーを処理します。
            }
        }
);
```

エンドユーザーの体験を向上させるには、予測可能なタイミングで更新をトリガーします：

* デフォルトカードが設定された後。
* 決済が完了した後。


---

# 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/ja/implement-nfc-wallet/make-payment/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.
