コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
開発者向けのツール
始める
支払い
財務の自動化
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
概要すべての商品を確認する
構築を開始する
開発の開始
サンプルプロジェクト
API について
    API ツアー
    Payment Intents API
      PaymentIntents の仕組み
      支払いステータスの更新
      非同期キャプチャー
      Charges API との比較
    Setup Intents API
    支払い方法
    商品と価格
    以前の API
    リリースフェーズ
Build with LLMs
ノーコードで Stripe を使用する
Stripe を設定する
アカウントを作成する
ウェブダッシュボード
モバイルダッシュボード
Stripe に移行
不正利用のリスク管理
不正利用について
Radar の不正防止
不審請求の申請の管理
本人確認
ホーム始めるAbout the APIsPayment Intents API

注

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

非同期キャプチャー

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

ページをコピー

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

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

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

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