Welcome to our new developer portal! Use the "Ask" button to chat with our AI Agent.
For the complete documentation index, see llms.txt. This page is also available as Markdown.

5. 取引コンテキストを表示する

処理 ContactlessPaymentSession.Event.transactionCompleted 最終ユーザーに支払い状況を表示するために。

このイベントには TransactionContext 取引の重要な詳細を含んでいます。

完了イベントを処理する

あなたの ContactlessPaymentSession.eventStream ループで、次を処理します:

  • .transactionCompleted(let transactionContext)

使用する transactionContext UIを更新し、必要な後続アクションをトリガーするために。

TransactionContext のフィールド

TransactionContext 通常は次を含みます:

  • aid: EMVアプリケーション識別子(AID)。

  • amount: 取引金額(UI表示用に整形済み)。

  • rawAmount: 端末から受け取った生の金額値。

  • currencyCode: ISO-4217の数値通貨コード。

  • transactionDate: 取引日(YYMMDD、BCDエンコード)。

  • transactionType: 取引タイプコード(例:購入、返金など)。

  • digitalCardID: 支払いに使用されたデジタルカード識別子。

  • スキーム: 支払いネットワーク(例:Visa や Mastercard)。

  • isTransit: その取引が交通系取引かどうかを示します。

  • transactionID: 取引識別子。

実装手順については、以下のサンプルコードをご参照ください:

最終更新

役に立ちましたか?