コンテンツにスキップ
アカウント作成/サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成サインイン
導入方法
決済管理
売上管理
プラットフォームとマーケットプレイス
資金管理
開発者向けリソース
API & SDKヘルプ
概要決済を受け付ける構築済みのシステムをアップグレード
オンライン決済
概要ユースケースを見つける
Payment Links を使用する
事前構築済みの決済ページを使用する
Elements を使用したカスタム統合の構築
アプリ内実装を構築
Managed Payments を使用する継続課金
対面決済
Terminal
    概要
    対面支払いを受け付ける
    利用可能な国
    導入方法の設計
    リーダーを選択
    導入方法の設計
    クイックスタート
    サンプルアプリケーション
    テスト
    Terminal の設定
    実装方法を設定する
    Connect での複数の売り手への支払い
    リーダーに接続する
    決済の受け付け
    カード支払いを回収
    追加の決済手段
    オフライン決済を受け付ける
    通信販売/電話販売の決済
    地域的な考慮事項
    購入時
    チップを回収する
    将来の使用に備えて支払い情報を収集して保存する
    柔軟なオーソリ
    決済後
    返金の取引
    領収書の提供
    Checkout のカスタマイズ
    カートの表示
    画面上の入力を収集
    スワイプで取得されたデータを収集
    NFC 機器のタップによって取得したデータを収集
    Apps on Devices
    リーダーを管理
    リーダーの注文、返品、交換
    リーダーの登録
    場所とゾーンの管理
    リーダーの設定
    リーダーを監視する
    リファレンス
    API リファレンス
    モバイルリーダー
    スマートリーダー
    Tap to Pay 対応リーダー
    SDK 移行ガイド
      SDK v4 移行ガイド
      SDK v3 移行ガイド
    デプロイのチェックリスト
    Stripe Terminal リーダー製品シート
決済手段
決済手段を追加
決済手段を管理
Link による購入の迅速化
決済業務
アナリティクス
残高と売上処理にかかる期間
コンプライアンスとセキュリティ
通貨
支払い拒否
不審請求の申請
不正利用防止
Radar の不正防止
入金
領収書返金とキャンセル
高度な連携システム
カスタムの決済フロー
柔軟なアクワイアリング
複数の決済代行業者のオーケストレーション
決済以外の機能
会社を設立する
暗号資産
エージェント型コマース
Financial Connections
Climate
本人確認
アメリカ
日本語
ホーム決済管理Terminal

Terminal SDK 移行ガイド

Stripe Terminal SDK (バージョン 5.0.0) への移行方法を解説します。

Stripe Terminal iOS SDK および Android SDK が更新され、API と動作への重要な変更がいくつか行われました。その一部については Stripe Terminal SDK のシステムアップグレードが必要になります。Stripe は、SDK 間の一貫性を向上させ、アプリケーションロジックとシステムを効率化するために、定期的にメジャーバージョンの更新を行い、システムの機能や動作に影響を与える変更を加えています。このガイドでは、システムのアップグレードに関わる最新の変更について解説します。

メモ

新しい Stripe Terminal の導入を構築する場合は、導入を設計するページをご参照ください。

バージョン 5.0.0 への移行

Stripe Terminal iOS および Android の SDK バージョン 5.0.0 に関する変更点は、以下のとおりです。

  • シンプルな決済統合
    • 収集する手順と確定する手順を組み合わせた 1 回のメソッド呼び出しで、決済、セットアップインテント、返金を処理します。
  • Swift の最新非同期バリアントと Kotlin Coroutines をサポートし、複雑な非同期フローを簡素化
    • iOS では Swift の並行処理 (async/await)、Android では Kotlin のコルーチン。
  • 顧客キャンセルはデフォルトで有効
    • サポート対象のリーダーでは、顧客は決済、セットアップ、返金、データ収集フロー中にデフォルトで取引をキャンセルできるようになりました。
  • モバイルリーダーと Tap to Pay リーダーの自動再接続の可観測性の向上
    • モバイルリーダー (Bluetooth および USB) および Tap to Pay リーダーの接続ステータスの状態を増やし、リーダーの自動再接続処理を強化。
  • Android の Tap to Pay の Discover カード受け付けサポート 公開プレビュー
    • Android の Tap to Pay で Discover カード決済を受け付けます。
  • iOS 14.0 から iOS 15.0 へのミニマムサポートプラットフォームバージョンの更新

アプリケーションで現在 5.0.0 より前のバージョンの Terminal iOS SDK を使用している場合は、アップグレードするためにいくつかの変更を行う必要があります。バージョン 4.x から 5.0.0 への変更の詳細なリストについては、SDK 変更ログを参照してください。

iOS 15 以降のミニマムサポートバージョンに関する更新

Stripe は、開発者サポート業務を効率化するために SDK のミニマムサポートバージョンを定期的に更新しています。

現行の Terminal iOS SDK バージョン 4.X は、引き続き iOS 14 以降で動作するデバイスをサポートします。

シンプルな決済統合

統合決済処理への更新

v5 SDK には、収集するステップと確定するステップを 1 つの操作に統合するメソッドが含まれています。既存の collectPaymentMethod メソッドと confirmPaymentIntent メソッドは引き続き機能しますが、よりシンプルな統合には統合メソッドの使用をお勧めします。

processPaymentIntent で決済を処理する

2 ステップの収集と確定を、1 つの processPaymentIntent メソッド呼び出しに置き換えます。

_導入前 _

Swift
Objective-C
No results
// Step 1: Collect payment method Terminal.shared.collectPaymentMethod(paymentIntent, collectConfig: collectConfig) { collectedPaymentIntent, collectError in guard let collectedPaymentIntent = collectedPaymentIntent else { // Payment method collection failed return } // Step 2: Confirm the payment Terminal.shared.confirmPaymentIntent(collectedPaymentIntent) { confirmedPaymentIntent, confirmError in if let confirmedPaymentIntent = confirmedPaymentIntent { // Payment successful } else { // Payment confirmation failed } } }

導入後

Swift
Objective-C
No results
// Process and confirm the payment in one step Terminal.shared.processPaymentIntent(paymentIntent, collectConfig: collectConfig) { processedPaymentIntent, processError in if let processedPaymentIntent = processedPaymentIntent { // Payment successful } else { // Payment failed } }

processRefund で返金を処理する

collectRefundPaymentMethod メソッドと confirmRefund メソッドは非推奨になりました。代わりに processRefund を使用してください。

_導入前 _

Swift
Objective-C
No results
// Step 1: Collect refund payment method Terminal.shared.collectRefundPaymentMethod(refundParams) { collectError in guard collectError == nil else { // Refund collection failed return } // Step 2: Confirm the refund Terminal.shared.confirmRefund { refund, confirmError in if let refund = refund { // Refund successful } else { // Refund confirmation failed } } }

導入後

Swift
Objective-C
No results
// Process the refund in one step Terminal.shared.processRefund(refundParams) { refund, refundError in if let refund = refund { // Refund successful } else { // Refund failed } }

processSetupIntent を使用してセットアップインテントを処理する

2 ステップの収集と確定を、1 つの processSetupIntent メソッド呼び出しに置き換えます。

_導入前 _

Swift
Objective-C
No results
// Step 1: Collect setup intent payment method Terminal.shared.collectSetupIntentPaymentMethod(setupIntent, customerConsentCollected: true) { collectedSetupIntent, collectError in guard let collectedSetupIntent = collectedSetupIntent else { // Setup intent collection failed return } // Step 2: Confirm the setup intent Terminal.shared.confirmSetupIntent(collectedSetupIntent) { confirmedSetupIntent, confirmError in if let confirmedSetupIntent = confirmedSetupIntent { // Setup intent successful } else { // Setup intent confirmation failed } } }

導入後

Swift
Objective-C
No results
// Configure with allowRedisplay let config = try CollectSetupIntentConfigurationBuilder() .setAllowRedisplay(.always) .build() // Process the setup intent in one step Terminal.shared.processSetupIntent(setupIntent, collectConfig: config) { processedSetupIntent, setupError in if let processedSetupIntent = processedSetupIntent { // Setup intent successful } else { // Setup intent failed } }

Swift 非同期バリアントサポート

SDK は Terminal メソッドに非同期バリアントを提供するようになりました。補完ハンドラを入れ子にする代わりに、よりすっきりとした連続的なコードを作成できます。

_導入前 _

let cancelable = Terminal.shared.collectPaymentMethod(paymentIntent, collectConfig: collectConfig) { collectedPaymentIntent, collectError in guard let collectedPaymentIntent = collectedPaymentIntent else { // Payment method collection failed return } Terminal.shared.confirmPaymentIntent(collectedPaymentIntent) { confirmedPaymentIntent, confirmError in // Handle confirmation } }

導入後

let collectTask = Task { do { let collectedIntent = try await Terminal.shared.collectPaymentMethod(paymentIntent, collectConfig: collectConfig) let confirmedIntent = try await Terminal.shared.confirmPaymentIntent(collectedIntent) // Payment successful } catch { // Handle error } } // Use collectTask.cancel() to cancel the operation when needed

プラットフォームと初期化

Terminal 初期化の更新

setTokenProvider メソッドは削除されました。Terminal.shared シングルトンにアクセスする前に、静的な Terminal.initWithTokenProvider(_tokenProvider:) メソッドを使用して SDK を初期化する必要があります。

_導入前 _

Swift
Objective-C
No results
// In your AppDelegate or scene delegate Terminal.setTokenProvider(yourTokenProvider)

導入後

Swift
Objective-C
No results
// In your AppDelegate or scene delegate, at app launch Terminal.initWithTokenProvider(yourTokenProvider)

リーダーの検出と接続

DiscoveryConfiguration 初期化の更新

DiscoveryConfiguration オブジェクトを init または new で直接初期化できなくなりました。関連するビルダークラスを使用する必要があります。

_導入前 _

Swift
Objective-C
No results
let config = SCPInternetDiscoveryConfiguration(isSimulated: true)

導入後

Swift
Objective-C
No results
let config = InternetDiscoveryConfiguration.Builder() .setSimulated(true) .build()

再接続ステータス変更の処理

新しい .reconnecting 値が ConnectionStatus 列挙型に追加されました。再接続中は、再接続が成功するまで Terminal.shared.connectedReader は nil になります。

_導入前 _

Swift
Objective-C
No results
func terminal(_ terminal: Terminal, didChange connectionStatus: ConnectionStatus) { switch connectionStatus { case .notConnected: // Handle not connected case .connected: // Handle connected @unknown default: break } }

導入後

Swift
Objective-C
No results
func terminal(_ terminal: Terminal, didChange connectionStatus: ConnectionStatus) { switch connectionStatus { case .notConnected: // Handle not connected case .connected: // Handle connected case .reconnecting: // Handle reconnection in progress @unknown default: break } }

easyConnect による効率的な接続

iOS SDK 5.1 以降を使用したスマートリーダーと Tap to Pay の実装では、検出と接続を 1 つのメソッド呼び出しにまとめた Terminal.shared.easyConnect を使用できるようになりました。

_導入前 _

Swift
Objective-C
No results
// Step 1: Discover the reader Terminal.shared.discoverReaders(config, delegate: discoveryDelegate) { error in if let error = error { // Handle discovery error } } // In your DiscoveryDelegate func terminal(_ terminal: Terminal, didUpdateDiscoveredReaders readers: [Reader]) { guard let selectedReader = readers.first else { return } // Step 2: Connect to the reader Terminal.shared.connectReader(selectedReader, connectionConfig: connectionConfig) { reader, error in if let reader = reader { // Handle successful connection } else if let error = error { // Handle connection error } } }

導入後

Swift
Objective-C
No results
// Discover and connect in one step by providing discovery filter let discoveryConfig = try InternetDiscoveryConfigurationBuilder() .setLocationId("tml_1234567890") // optional, specify your location ID .setDiscoveryFilter(.bySerial("YOUR-READER-SERIAL-NUMBER")) .build() let connectionConfig = try InternetConnectionConfigurationBuilder() .setFailIfInUse(false) .build() let easyConnectConfig = InternetEasyConnectConfiguration( discoveryConfiguration: discoveryConfig, connectionConfiguration: connectionConfig ) Terminal.shared.easyConnect( easyConnectConfig, delegate: internetReaderDelegate ) { reader, error in if let reader = reader { // Handle successful connection } else if let error = error { // Handle failure } }

インターネットリーダーの検出フィルタリング

インターネットリーダーの検出で、リーダー ID またはシリアル番号によるフィルタリングがサポートされるようになりました。特定のリーダーを検出するには、InternetDiscoveryConfigurationBuilder の discoveryFilter プロパティを設定します。

_導入前 _

Swift
Objective-C
No results
let config = InternetDiscoveryConfigurationBuilder() .setLocationId("tml_1234567890") .build()

導入後

Swift
Objective-C
No results
let config = try InternetDiscoveryConfigurationBuilder() .setLocationId("tml_1234567890") // optional .setDiscoveryFilter(.bySerial("READER-SERIAL-NUMBER")) // or .byReaderId("tmr_YOUR-READER-STRIPE-ID") to filter by reader id .build()

決済の受け付けとデータ収集

顧客キャンセルがデフォルトで有効になりました

サポート対象のリーダーでは、顧客が取引をキャンセルする機能が デフォルトで有効 になりました。customerCancellation プロパティは Bool から新しい SCPCustomerCancellation 列挙型に変更されました。

_導入前 _

Swift
Objective-C
No results
let collectConfig = try CollectConfigurationBuilder() .setEnableCustomerCancellation(false) .build()

導入後

Swift
Objective-C
No results
let collectConfig = try CollectPaymentIntentConfigurationBuilder() .setCustomerCancellation(.disableIfAvailable) .build()

Interac 返金パラメーターの更新

PaymentIntent ID を使用して Interac 返金の SCPRefundParameters を作成する場合は、PaymentIntent の clientSecret も渡す必要があります。clientSecret を必要としない請求 ID を引き続き使用することもできます。

_導入前 _

Swift
Objective-C
No results
let refundParams = try RefundParametersBuilder( paymentIntentId: "pi_123", amount: 1000, currency: "cad" ).build()

導入後

Swift
Objective-C
No results
let refundParams = try RefundParametersBuilder( paymentIntentId: "pi_123", clientSecret: "pi_123_secret_abc", amount: 1000, currency: "cad" ).build()
このページはお役に立ちましたか。
はいいいえ
  • お困りのことがございましたら 、サポートにお問い合わせください。
  • 変更ログをご覧ください。
  • ご不明な点がございましたら、お問い合わせください。
  • LLM ですか?llms.txt を読んでください。
  • Powered by Markdoc