> 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/classic-push-provisioning/ja/ysuksu/to/tkunwo.md).

# 表示: トークン一覧を取得

Push Provisioning SDK を使用すると、イシュアアプリは特定のカードのトークン一覧とそれらのトークンがリクエストされた場所を取得できます。エンドユーザーはトークン一覧を参照して以下を表示できます：

* トークンの状態（有効か無効か）。
* トークンリクエスタ識別子。
* デバイス情報（TSP によって提供される場合のデバイス ID、名前、タイプなど）。
* トークンの有効期限日。
* トークンの下4桁。
* そのトークンが現在のデバイス上にあるかどうか（`isOnCurrentDevice`）（イシュアアプリが Google Pay、Samsung Pay、または Apple Pay 用に構成されている場合）。

以下の図は、イシュアアプリが実装できるユーザー体験の例を示しています：

<figure><img src="/files/9a416b34cdfa8e07a5fdd8e2e2380dc789d65f8c" alt=""><figcaption><p>トークン一覧のユーザー体験の例。</p></figcaption></figure>

Push Provisioning SDK はトークン一覧を取得するためにカード情報（PAN と有効期限）を必要とします。以下の図はイシュアアプリが実装するフローの概要を示しています：

<figure><img src="/files/3592afd279bd8f605ac50fcf0d0fc3d56b29bb56" alt=""><figcaption><p>トークン一覧取得フロー。</p></figcaption></figure>

\
**注意**

* 決済ネットワークの制限により、トークンリクエスタの名前とロゴをリアルタイムで取得することはできません。
* イシュアアプリは上位5〜10のトークンリクエスタ識別子を特定し、加盟店またはウォレット向けの名称とロゴをハードコードすることを推奨します。

### SDK 統合 <a href="#sdk-integration" id="sdk-integration"></a>

#### ステップ 1: 暗号化されたカード詳細の取得 <a href="#step-1-getting-the-encrypted-card-details" id="step-1-getting-the-encrypted-card-details"></a>

トークン一覧を取得するには、イシュアアプリは暗号化されたカード詳細を Push Provisioning SDK に提供する必要があります。

イシュアのバックエンドは暗号化されたカード詳細をイシュアアプリに提供します。カード詳細は [PKCS#7 形式](/classic-push-provisioning/ja/gaido/dtanoto/kdodtanopkcs7.md).

#### ステップ 2: トークン一覧の取得 <a href="#step-2-getting-the-token-list" id="step-2-getting-the-token-list"></a>

イシュアアプリがイシュアバックエンドから暗号化されたカード詳細を取得した後、トークン一覧をリクエストできます。

以下のコードスニペットは Push Provisioning SDK を介してトークン一覧を取得する方法の例を示しています：

{% tabs %}
{% tab title="Swift" %}

```swift
func getTokens() {
    let scheme = CardScheme.Mastercard
    let payload = "PKCS7 encrypted PAN"
    
    let card = FundingCard(scheme: scheme,
                           encryptedPayload: payload)
    
    TPCSDK.getTokens(card: card) {
      (tokenList, error) in
      if let tokenList = tokenList {
          for token in tokenList {
              if(token.isOnCurrentDevice){
                  // このトークンは現在のデバイス上にあります。
              }
          }
      }
    }
  }
```

{% endtab %}

{% tab title="Objective-C" %}

```objective-c
- (void) getTokens {
  CardScheme scheme = CardSchemeMastercard;
  NSString * payload = @"PKCS7 encrypted PAN";
  
  FundingCard * card = [[FundingCard alloc] initWithScheme:scheme
                                          encryptedPayload:payload];
  
  [TPCSDK getTokensWithCard:card
                 completion:^(NSArray<Token *> * _Nullable tokenList, NSError * _Nullable error) {
  }];
}
```

{% endtab %}

{% tab title="Android" %}

```java
CardInfo cardInfo = new CardInfo();
cardInfo.setScheme("VISA");
cardInfo.setEncryptedPayload("PAYLOAD")
cardInfo.setAuthorizationCode("AUTHORIZATION_CODE");
cardInfo.setLast4PanDigits("1234");
cardInfo.setIssuerAppId("ISSUERID");

final TPCSDKListener<Token[]> tokenListener = new TPCSDKListener<Token[]>() {
    @Override
    public void onStart() {
        // on start
    }

    @Override
    public void onSuccess(TPCResult<Token[]> result) {
	      Log.i("TAG", "get tokenLsit request success");
        Token[] tokens = result.getResult();
        if (tokens != null) {
          for (int i = 0; i < tokens.length; i++) {
            if (tokens[i].isOnCurrentDevice()) {
              // このトークンは現在のデバイス上にあります。
            }
          }
        }
    }

    @Override
    public void onError(TPCSDKException exception) {
        // トークン一覧取得中のエラー
        Log.i("TAG", "get tokenList request failed");
    }
};

TPCManager.getInstance().getTSHProxy().getTokenList(cardInfo, tpcsdkListener);
```

{% endtab %}
{% endtabs %}


---

# 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/classic-push-provisioning/ja/ysuksu/to/tkunwo.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.
