コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
開発者向けのツール
始める
支払い
財務の自動化
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるManaged Payments
Payment Links を使用する
決済ページを構築
高度なシステムを構築
アプリ内実装を構築
決済手段
決済手段を追加
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内 Elements
決済シナリオ
カスタムの決済フロー
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
    概要
    対面支払いを受け付ける
    導入方法の設計
    リーダーを選択
    導入方法の設計
    クイックスタート
    サンプルアプリケーション
    テスト
    Terminal の設定
    実装方法を設定する
    リーダーに接続する
    決済の受け付け
    カード支払いを回収
      サポート対象のカードブランド
    追加の支払い方法
    オフライン決済を受け付ける
    通信販売/電話販売の決済
    地域的な考慮事項
    購入時
    チップを回収する
    将来の使用に備えて支払い情報を収集して保存する
    柔軟なオーソリ
    決済後
    返金の取引
    領収書の提供
    Checkout のカスタマイズ
    カートの表示
    画面上の入力を収集
    スワイプで取得されたデータを収集
    NFC 機器のタップによって取得したデータを収集
    Apps on Devices
    リーダーを管理
    リーダーの注文、返品、交換
    リーダーの登録
    場所とゾーンの管理
    リーダーの設定
    暗号化
    リファレンス
    API リファレンス
    モバイルリーダー
    スマートリーダー
    SDK 移行ガイド
    デプロイのチェックリスト
    Stripe Terminal リーダー製品シート
他の Stripe プロダクト
Financial Connections
仮想通貨
Climate
ホーム支払いTerminal

注

このページはまだ日本語ではご利用いただけません。より多くの言語で文書が閲覧できるように現在取り組んでいます。準備が整い次第、翻訳版を提供いたしますので、もう少しお待ちください。

カード支払いを回収する

Stripe Terminal を使用したカード支払いの回収ができるように、アプリケーションとバックエンドを準備します。

ページをコピー

注

For smart readers, such as the BBPOS WisePOS E reader or Stripe Reader S700, we recommend using the server-driven integration instead of the JavaScript SDK. The server-driven integration uses the Stripe API instead of relying on local network communications to collect payments. See our platform comparison to help you choose the best platform for your needs.

もっと知る

Payment Intents API を初めて使用する場合には、以下のリソースが役立ちます。

  • Payment Intents API
  • PaymentIntent (支払いインテント) オブジェクト
  • その他の支払いシナリオ

Stripe Terminal で支払いを回収するには、アプリケーションに決済フローを記述する必要があります。Stripe Terminal SDK を使用して、1 つの支払いセッションを表すオブジェクトである PaymentIntent (支払いインテント) を作成して更新します。

Terminal の組み込みは支払いプロセスにおける失敗に対応できるように設計されており、支払いプロセスを複数のステップに分割し、各ステップを安全に再試行できるようになっています。

  1. Create a PaymentIntent.
  2. Collect a payment method. You can define whether to automatically or manually capture your payments.
  3. Process the payment. Authorization on the customer’s card takes place when the SDK processes the payment.
  4. (オプション) 支払いをキャプチャーする

注

This integration shape does not support offline card payments.

Create a PaymentIntent
サーバー側

The first step when collecting payments is to start the payment flow. When a customer begins checking out, your application must create a PaymentIntent object. This represents a new payment session on Stripe.

Use test amounts to try producing different results. An amount ending in 00 results in an approved payment.

The following example shows how to create a PaymentIntent on your server:

Command Line
curl
curl https://api.stripe.com/v1/payment_intents \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -d "amount"=1000 \ -d "currency"="usd" \ -d "payment_method_types[]"="card_present" \ -d "capture_method"="manual"

For Terminal payments, the payment_method_types parameter must include card_present.

You can control the payment flow as follows:

  • To fully control the payment flow for card_present payments, set the capture_method to manual. This allows you to add a reconciliation step before finalizing the payment.
  • To authorize and capture payments in one step, set the capture_method to automatic.

To accept Interac payments in Canada, you must also include interac_present in payment_method_types. For more details, visit our Canada documentation.

The PaymentIntent contains a client secret, a key that’s unique to the individual PaymentIntent. To use the client secret, you must obtain it from the PaymentIntent on your server and pass it to the client side.

Ruby
post '/create_payment_intent' do intent = # ... Create or retrieve the PaymentIntent {client_secret: intent.client_secret}.to_json end

Use the client secret as a parameter when calling collectPaymentMethod.

The client_secret is all you need in your client-side application to proceed to payment method collection.

支払い方法を収集する
クライアント側

SDK リファレンス

  • collectPaymentMethod (JavaScript)

After you’ve created a PaymentIntent, the next step is to collect a payment method with the SDK.

To collect a payment method, your app needs to be connected to a reader. The connected reader waits for a card to be presented after your app calls collectPaymentMethod.

async () => { // clientSecret is the client_secret from the PaymentIntent you created in Step 1. const result = await terminal.collectPaymentMethod(clientSecret); if (result.error) { // Placeholder for handling result.error } else { // Placeholder for processing result.paymentIntent } }

This method collects encrypted payment method data using the connected card reader, and associates the encrypted data with the local PaymentIntent.

支払い方法の詳細をオプションで調査する

SDK リファレンス

  • collectPaymentMethod config_override (JavaScript)

高度なユースケースでは、提示されたカードの支払い方法の詳細を調査し、オーソリ前に自社のビジネスロジックを実行できます。

Use the update_payment_intent parameter to attach a PaymentMethod to the server-side PaymentIntent. This data is returned in the collectPaymentMethod response.

async () => { // clientSecret is the client_secret from the PaymentIntent you created in Step 1. const result = await terminal.collectPaymentMethod(clientSecret, { config_override: { update_payment_intent: true } }); if (result.error) { // Placeholder for handling result.error } else { const pm = result.paymentIntent.payment_method const card = pm?.card_present ?? pm?.interac_present // Placeholder for business logic on card before processing result.paymentIntent } }

注

This method attaches the collected encrypted payment method data with an update to the PaymentIntent object. It requires no authorization until the next step, process the payment.

This advanced use case isn’t supported on the Verifone P400.

After payment method collection you must authorize the payment or cancel collection within 30 seconds.

If the SDK is operating offline, the paymentMethod field isn’t present in the PaymentIntent object.

この時点で、カードブランド、口座情報、その他の役立つデータなどの属性にアクセスできます。

注

Stripe は wallet.type 属性で示すとおり、取引でモバイルウォレットが使用されたかどうかを検出するよう試みます。ただし、カード発行会社がモバイルウォレットのリーダーによる識別に対応していない場合、この属性は自動入力されないため、正確な検出は保証されません。確定ステップでオーソリが行われた後に、Stripe はネットワークから最新の情報を取得し、wallet.type を確実に更新します。

収集をキャンセルする

プログラムによるキャンセル

You can cancel collecting a payment method by calling cancelCollectPaymentMethod in the JavaScript SDK.

顧客によるキャンセル

SDK リファレンス

  • enable_customer_cancellation (JavaScript)

When you set enable_customer_cancellation to true for a transaction, smart reader users see a cancel button.

Tapping the cancel button cancels the active transaction.

terminal.collectPaymentMethod( clientSecret, { config_override: { enable_customer_cancellation: true } } )

イベントを処理する

注

The JavaScript SDK only supports the Verifone P400, BBPOS WisePOS E, and Stripe Reader S700, which have a built-in display. Your application doesn’t need to display events from the payment method collection process to users, because the reader displays them. To clear the payment method on a transaction, the cashier can press the red X key.

支払いを確定する
クライアント側

SDK リファレンス

  • processPayment (JavaScript)

After successfully collecting a payment method from the customer, the next step is to process the payment with the SDK. When you’re ready to proceed with the payment, call processPayment with the updated PaymentIntent from Step 2.

  • 支払いの手動キャプチャーでは、processPayment コールが成功すると、PaymentIntent のステータスが requires_capture になります。
  • 支払いの自動キャプチャーでは、PaymentIntent は succeeded 状態に移行します。
async () => { const result = await terminal.processPayment(paymentIntent); if (result.error) { // Placeholder for handling result.error } else if (result.paymentIntent) { // Placeholder for notifying your backend to capture result.paymentIntent.id } }

警告

You must manually capture a PaymentIntent within 2 days or the authorization expires and funds are released to the customer.

失敗に対処する

SDK リファレンス

  • Error codes (JavaScript)

支払いの処理に失敗した場合、SDK は、更新された PaymentIntent を含むエラーを返します。アプリケーションでは、PaymentIntent を確認してエラーの対処方法を決定する必要があります。

PaymentIntent のステータス意味解決策
requires_payment_method支払い方法が拒否されましたTry collecting a different payment method by calling collectPaymentMethod again with the same PaymentIntent.
requires_confirmation一時的な接続の問題Call processPayment again with the same PaymentIntent to retry the request.
PaymentIntent is nilRequest to Stripe timed out, unknown PaymentIntent statusRetry processing the original PaymentIntent. Don’t create a new one, because that could result in multiple authorizations for the cardholder.

タイムアウトが複数回、連続して発生する場合、接続に問題がある可能性があります。アプリがインターネットと通信できることを確認してください。

二重支払いの防止

The PaymentIntent object enables money movement at Stripe—use a single PaymentIntent to represent a transaction.

Re-use the same PaymentIntent after a card is declined (for example, if it has insufficient funds), so your customer can try again with a different card.

If you edit the PaymentIntent, you must call collectPaymentMethod to update the payment information on the reader.

A PaymentIntent must be in the requires_payment_method state before Stripe can process it. An authorized, captured, or canceled PaymentIntent can’t be processed by a reader.

支払いをキャプチャーする
サーバー側

ステップ 1 の PaymentIntent の作成時に capture_method を manual として定義した場合、SDK はオーソリ済みでキャプチャーはされていない PaymentIntent をアプリケーションに返します。オーソリとキャプチャーの違いについて、詳細を確認してください。

アプリが SDK から確定済みの PaymentIntent を受信したら、その支払いをキャプチャーするようにアプリからバックエンドに対して通知するようにしてください。バックエンドにエンドポイントを作成し、PaymentIntent ID を受け付け、それをキャプチャーするように Stripe API にリクエストを送信します。

Command Line
cURL
curl -X POST https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT_ID}}/capture \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

capture コールが成功すると、PaymentIntent のステータスは succeeded になります。

注

To make sure the application fee captured is correct for connected accounts, inspect each PaymentIntent and modify the application fee, if needed, before manually capturing the payment.

支払いを照合する

To monitor the payments activity of your business, you might want to reconcile PaymentIntents with your internal orders system on your server at the end of a day’s activity.

A PaymentIntent that retains a requires_capture status might represent two things:

顧客のカード明細上の不要なオーソリ

  • 原因: ユーザーが取引の途中でアプリの決済フローを中止した
  • Solution: If the uncaptured PaymentIntent isn’t associated with a completed order on your server, you can cancel it. You can’t use a canceled PaymentIntent to perform charges.

顧客からの売上回収が未完了

  • 原因: 支払いをキャプチャーするようにバックエンドに通知する、アプリからのリクエストのエラー
  • Solution: If the uncaptured PaymentIntent is associated with a completed order on your server, and no other payment has been taken for the order (for example, a cash payment), you can capture it.

チップを徴収する アメリカのみ

アメリカでは、対象ユーザーは支払いのキャプチャー時にチップを徴収できます。

このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc