> 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/push-provisioning/ja/implement-push-provisioning/implement-push-to-digital-wallets/push-to-the-digital-wallet.md).

# デジタルウォレットへのプッシュ

## デジタルウォレットへのプッシュ

このガイドを使用して、D1 SDK を使い、イシュアアプリケーションからデジタルウォレットアプリケーションへカードをプッシュします。サポートされているウォレットアプリケーションは Google Pay、Samsung Pay、Apple Pay です。

エンドユーザーがタップしたときにこの API を呼び出します **ウォレットに追加** かつ、カードのデジタル化状態が `NOT_DIGITIZED`。状態を取得するには、を参照してください [カードのデジタル化状態を取得する](/push-provisioning/ja/implement-push-provisioning/implement-push-to-digital-wallets/get-the-card-digitization-state.md).

### 概要

イシュアアプリケーションは D1 SDK を呼び出します `addDigitalCardToOEM()` プッシュプロビジョニングフローを開始する API です。D1 SDK と D1 バックエンドは次のことを行います:

* D1 に保存されているエンドユーザーとカードデータを検証します。
* ウォレットアプリケーションと TSP に必要なペイロードを準備します。
* ウォレットアプリケーションを呼び出してトークン化を開始します。
* 結果を返し、イシュアアプリケーションが UI を更新できるようにします。

{% hint style="info" %}

* のみ呼び出してください `addDigitalCardToOEM()` D1 SDK が戻った後に `NOT_DIGITIZED` から `getCardDigitizationState()`.
* Android の Google Pay では、実装する必要があります `onActivityResult` そうすることで、ウォレットの結果が D1 SDK に再送されます。
* 2024 年 6 月 10 日以降、 [Google Wallet](https://developers.google.com/wallet/docs/release-notes?utm_source=chatgpt.com#June_04_2024) Android 9 以上が必要です。
  {% endhint %}

### フロー

<figure><img src="/files/1302c1ddf3f9d71777ba613e0c9a85ffa246d587" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/3fe2300561477ff957ab5c2820df0effc24ccbe3" alt=""><figcaption></figcaption></figure>

#### シーケンス図

**前提条件**

* エンドユーザーとカードは D1 に登録されています。
* D1 SDK は初期化されています。
* イシュアアプリケーションが D1 SDK のログイン API を呼び出しています。

<figure><img src="/files/f2e623d2e9ee3b81b0df86acb947229ce5a49b48" alt="High-level sequence for pushing a card to a digital wallet"><figcaption><p>D1 SDK を使用して、イシュアアプリケーションからデジタルウォレットへカードをプッシュする際の高レベルなシーケンス。</p></figcaption></figure>

### プラットフォーム統合

{% tabs %}
{% tab title="Android" %}
Android 2.4.0 以降では、次を使用します `D1PushWallet.addDigitalCardToOEM()`.

```kotlin
//activity: OEM Push Provisioning 用の現在のアクティビティ。
//cardID: 受信したカード ID。
fun pushCardToWallet_v2_4_0(d1Task: D1Task, cardID: String, activity: Activity) {
    val wallet = OEMPayType.GOOGLE_PAY //GOOGLE_PAY, SAMSUNG_PAY, NONE
    val callback: D1Task.Callback<Any?> = object : D1Task.Callback<Any?> {

        override fun onSuccess(data: Any?) {
            // サーバーからの `digitalCardStatus` オブジェクトを処理します。
        }

        override fun onError(exception: D1Exception) {
            // D1 SDK 統合 – エラー管理 セクションを参照してください。
        }
    }
    val d1PushWallet : D1PushWallet = d1Task.d1PushWallet
    d1PushWallet.addDigitalCardToOEM(cardID, wallet, activity, callback)
}

// 注: すべてのコールバックイベントを SDK に転送するには、`onActivityResult` メソッドを実装します。

// Activity Result: `onActivityResult` メソッドは GPay SDK からイシュアアプリに受け取られ、結果を処理するために D1 SDK に渡されます。
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
    d1Task.handleCardResult(requestCode, resultCode, data);
}
```

{% endtab %}

{% tab title="iOS" %}
iOS では、次を使用します `addDigitalCardToOEM(_:viewController:completion:)`.

```swift
let cardID = "" // イシュアアプリケーションによって取得されます。たとえばバックエンドから取得します
let viewController = /* Apple Pay UI を表示している現在の UIViewController インスタンス */

d1Task.addDigitalCardToOEM(cardID, viewController: viewController) { error in
    if let error = error {
        // D1 SDK 統合のエラー管理セクションを参照してください
    } else {
        // UI を更新します。たとえば、カードが Apple Wallet に追加されたことを確認します
    }
}
```

{% endtab %}
{% endtabs %}

D1 SDK の詳細については、次を参照してください [API リファレンス](/push-provisioning/ja/integrate-the-d1-sdk/api-reference.md).


---

# 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/push-provisioning/ja/implement-push-provisioning/implement-push-to-digital-wallets/push-to-the-digital-wallet.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.
