> 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/transit-digitization/ja/apple-transit-no/kdobsunochikettingucbt/apuripurobijoningunopurodakuto.md).

# アプリ内プロビジョニング後の運賃プロダクト購入

In-AppのPost-Provisioning運賃商品購入ワークフローは、利用者が交通事業者のiOSアプリを通じて直接開始します。主な目的は、利用者がアプリ内で運賃商品を購入し、それがApple Wallet内の交通カードにシームレスに適用され、即時利用できるようにすることです。

### ワークフロー <a href="#workflow" id="workflow"></a>

以下はIn-AppのPost-Provisioning運賃商品購入ワークフローの高レベルな手順の概略です：

1. **運賃商品の選択と支払い**：利用者は交通事業者のiOSアプリから購入したい運賃商品を選択します。既存残高へのチャージや運賃商品の購入／更新が含まれる場合があります。
2. **アプレットの更新とWallet表示の更新**：CBTの文脈では、アプレットのコンテンツを更新する必要があります。「applet update」の意図を持つupdateBundleリクエストを受け取ると、Appleデバイスはアプレットコンテンツデータを更新するために実行すべきコマンドを取得するリクエストを行います。

新しい商品の購入の場合、Wallet表示を更新する必要があります。「pass update」の意図を持つupdateBundleリクエストを受け取ると、AppleはD1 Transitからカード詳細を含むプロビジョニングバンドルを要求します。

#### 運賃商品の選択と支払い <a href="#fare-product-selection-and-payment" id="fare-product-selection-and-payment"></a>

ワークフローが始まる前に、利用者は交通事業者のiOSアプリ内で交通カードに追加する有効な運賃商品を選択しておく必要があります。

運賃商品が選択されると、アプリは購入を完了するための支払いオプションを表示する必要があります。利用者は利用可能なオプションから希望の支払い方法を選択できます。

**エラーシナリオ**

**購入または更新が許可されていない**

ビジネスルールにより運賃商品の購入または更新が禁止されている場合（例：カードの有効期限切れや非適格な運賃商品）、交通事業者のiOSアプリは利用者にその旨を示すものとします。

#### アプレットの更新とWallet表示の更新 <a href="#applet-update-and-wallet-display-update" id="applet-update-and-wallet-display-update"></a>

運賃商品の購入または更新が正常に完了した後、Transit Issuerはアプレットデータを更新する旨をD1 Transitにリクエストで送信します。D1 Transitは、その後、intentionTypeパラメータをupdateAppletに設定してupdateBundle APIリクエストを行い、Appleに通知します。

updateBundleリクエストを受け取ると、Appleはデバイスに対して「redirect」コマンドを開始します。デバイスはアプレットデータコンテンツを更新するために実行すべきコマンドを取得するためにD1 Transitに接続します。そのために複数回の往復が発生することがあります。

アプレットデータが更新されると、D1 Transitはバンドルデータが正常に更新されたことをTransit Issuerに通知します。

購入された新しい商品については、バンドルデータの更新成功通知を受け取った後、Transit IssuerはWallet表示を更新するためにhandleEventをD1 Transitプラットフォームに送信します。

D1 Transitは、intentionTypeパラメータをupdatePassに設定してupdateBundle APIリクエストを行い、Appleに通知します。

updateBundleリクエストを受け取ると、AppleはD1 Transitに対してgetProvisioningBundleリクエストを行い、プロビジョニングバンドルを取得します。

バンドルがAppleに返された後、D1 Transitはバンドルが正常に更新されたことをTransit Issuerに通知します。

**エラーシナリオ**

**Appleからプロビジョニングバンドル取得のリクエストがない**

D1 Transitは、updateBundleの応答を受け取ってからAppleからのgetProvisioningBundleリクエストまでの間にタイムアウト期間を定めます。

指定したタイムアウト期間内にD1 TransitがgetProvisioningBundleリクエストを受領しない場合、D1 Transitは設定された再試行ポリシーを適用します。

すべての再試行が尽きてもgetProvisioningBundleリクエストが依然として受領されない場合、D1 Transitはその失敗をTransit Issuerに通知します。

<figure><img src="/spaces/SokLBgfEhZisVFcUdPiW/files/T9wOXwSk53oCrR0UcSBb" alt=""><figcaption></figcaption></figure>

<figure><img src="/spaces/SokLBgfEhZisVFcUdPiW/files/DkUhIEBzJDaLYNhqz0Uk" alt=""><figcaption></figcaption></figure>


---

# 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/transit-digitization/ja/apple-transit-no/kdobsunochikettingucbt/apuripurobijoningunopurodakuto.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.
