コンテンツにスキップ
アカウント作成/サインイン
Stripe ドキュメントのロゴ
/
AI に質問
アカウントを作成サインイン
導入方法
決済管理
売上管理
プラットフォームとマーケットプレイス
資金管理
開発者向けリソース
API & SDKヘルプ
概要すべてのプロダクト
API について
    API ツアー
    PaymentIntents と SetupIntents の仕組み
      PaymentIntents API
        支払いステータスの更新
        非同期キャプチャー
      SetupIntents の仕組み
    Payment Methods API
    Payment Records API
    商品と価格
    以前の API
Stripe 用語集
構築を開始する
アカウントを作成する
クイックスタート
開発の開始
LLM を活用して構築
ノーコードで Stripe を使用する
Stripe に移行
一般的なユースケース
概要スタートアップとしてシンプルな決済を受け付けるSaaS スタートアップとしてサブスクリプションを販売する使用量ベースの料金設定でサブスクリプションソリューションを構築する対面支払いを受け付ける請求書を送信して支払いを回収する
アメリカ
日本語
ホーム導入方法About the APIsHow PaymentIntents and SetupIntents workPaymentIntents API

メモ

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

非同期キャプチャー

非同期キャプチャーを使用して PaymentIntent 確定の高速化を有効にします。

非同期キャプチャーは、キャプチャー操作をバックグラウンドで実行することで、PaymentIntent の確定の遅延を短縮します。キャプチャーリクエストを行うと、システムは成功のレスポンスを受け取り、Stripe はバックエンドで支払いのキャプチャーを完了します。この PaymentIntent キャプチャーの高速化を使用するには、PaymentIntent の確定時に capture_method=automatic_async パラメーターを設定します。

非同期キャプチャーを選択する

既存の実装をアップグレードして非同期キャプチャーのサポートを追加するには、PaymentIntent を作成する際に、キャプチャー方法として automatic_async を使用します。Stripe は最新バージョンの API でその機能をデフォルトで有効にしているため、capture_method=automatic_async パラメーターの指定は必須ではありません。

Command Line
curl
Stripe CLI
Ruby
Python
PHP
Node.js
Java
Go
.NET
No results
curl https://api.stripe.com/v1/payment_intents \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -d amount=2000 \ -d currency=usd \ -d "payment_method_types[]"=card \ -d payment_method=pm_card_visa \ -d capture_method=automatic_async \ -d confirm=true

非同期キャプチャーを選択すると、API レスポンスと一部の Webhook は他のキャプチャー方法とは動作が異なるため、追加の変更が必要になる場合があります。

すべての支払いで、以下のオブジェクトの balance_transaction は null です。Connect の支払いの場合は、以下のオブジェクトの transfer と application_fee も null です。

  • API レスポンスの関連付けられた Charge オブジェクト
  • charge.succeeded Webhook
  • payment_intent.succeeded Webhook

charge.succeeded Webhook の変更された Charge オブジェクト:

# Charge Object { "id": "ch_123", "object": "charge", "amount_captured": 1000, # the capture has happened "application_fee_amount": 100, "captured": true, "balance_transaction": "txn_123", # applicable to all charges. "transfer": "tr_123", # applicable to destination charge only. "application_fee": "fee_123", # applicable to destination charge only. "balance_transaction": null, # object might not be created yet, might be shown as nil. "transfer": null, # object might not be created yet, might be shown as nil. "application_fee": null, # object might not be created yet, might be shown as nil. ... }

変更された API レスポインスと payment_intent.succeeded Webhook: (API バージョンによって異なります)

API バージョン 2022-11-15 以降
API バージョン 2022-08-01 以前
No results
# PaymentIntent Object { "id": "pi_123", "object": "payment_intent", "capture_method": "automatic_async", "status": "succeeded", "latest_charge": "ch_**" # if expanded, this is the Modified Charge object above }

Webhook をリッスンして、追加データが利用可能になったときに通知を受け取ります

警告

charge.updated Webhook の SLA は、PaymentIntent が正常に確定されてから 1 時間後です。

非同期キャプチャーを使用する場合は、Webhook をリッスンして、最初は null であったオブジェクトのステータスを確認できます。

  • balance_transaction を取得するには、charge.updated Webhook イベントに登録します。
  • application_fee を取得するには、application_fee.created Webhook イベントに登録します。
  • transfer を取得するには、transfer.created Webhook イベントに登録します。

非同期キャプチャーの Webhook

# charge.updated events { "data": { "id": "ch_123", "object": "charge", "amount": 100, "balance_transaction": "txn_123", # applicable to all charges. "transfer": "tr_123", # applicable to destination charge only. "application_fee": "fee_123", # applicable to destination charge only. ... }, previous_attributes: { "balance_transaction": null, # applicable to all charges. "transfer": null, # applicable to destination charge only. "application_fee": null, # applicable to destination charge only. } }
# transfer.created events { "data": { "id": "tr_123", "object": "transfer", "amount": 1000, ... } }
# application_fee.created events { "data": { "id": "fee_123", "object": "application_fee", "amount": 100, ... } }
このページはお役に立ちましたか。
はいいいえ
  • お困りのことがございましたら 、サポートにお問い合わせください。
  • Discord で Stripe の開発者とチャットしてください。
  • 変更ログをご覧ください。
  • ご不明な点がございましたら、お問い合わせください。
  • LLM は llms.txt を参照してください。
  • Powered by Markdoc
このページの内容