コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けリソース
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるUse Managed Payments
Payment Links を使用する
構築済みの決済ページを使用する
Build a custom integration with Elements
    概要
    Compare Checkout Sessions and PaymentIntents
    Quickstart guides
    高度なシステムを設計
    デザインをカスタマイズする
    決済手段を管理
      Express Checkout Element で決済を受け付ける
      カスタムの支払い方法を追加する
      支払い方法をカスタマイズする
      ダッシュボードに支払い方法を移行
    追加情報を収集する
    サブスクリプションの実装
    Dynamic updates
    割引を追加する
    支払いで税金を徴収
    顧客が現地通貨で支払いできるようにする
    顧客の支払い方法を保存および取得する
    領収書と支払い済みの請求書を送信する
    サーバーで支払いを手動で承認する
    支払いのオーソリとキャプチャーを分離する
    Elements with Checkout Sessions API ベータ版の変更ログ
アプリ内実装を構築
決済手段
決済手段を追加
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内決済
決済シナリオ
複数の通貨を扱う
カスタムの決済フロー
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
決済にとどまらない機能
会社を設立する
仮想通貨
Financial Connections
Climate
不正利用について
Radar の不正防止
不審請求の申請の管理
本人確認
ホーム支払いBuild a custom integration with ElementsManage payment methods

注

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

Migrate payment methods to the Dashboard

Learn how to turn on payment methods for your Checkout Session in the Dashboard.

You can update your integration to use your payment method preferences from the Dashboard. This allows Stripe to display all compatible payment methods to your customers during checkout, depending on the chosen currency, location, or any payment method restrictions, such as maximum transaction amounts.

The checkout page shows payment methods known to increase conversion for your customer’s location, and hides other payment methods in an overflow menu. Customers can still choose from the payment methods in the overflow menu.

Update your integration

For existing Stripe Checkout integrations, you must remove the payment_method_types parameter to migrate payment methods preferences to the Dashboard. Doing so allows some payment methods to turn on automatically, including cards and wallets. The currency parameter restricts the payment methods your customers see in the Checkout Session.

警告

When you upgrade your integration, non-default payment methods (such as bank redirects) are initially disabled. You must enable any payment methods you added to your Checkout integration from the payment methods settings page in the Dashboard.

server.rb
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
Stripe::Checkout::Session.create({ line_items: [ { price_data: { currency: 'eur', product_data: {name: 'T-shirt'}, unit_amount: 2000, }, quantity: 1, }, ], mode: 'payment', # Remove the payment_method_types parameter to manage payment methods in the Dashboard payment_method_types: ['card'], return_url: 'https://example.com/return', ui_mode: 'custom', })

View available payment methods in the Dashboard

You can view the payment methods that you currently accept from the payment methods settings in the Dashboard. The list includes payment methods that Stripe enables by default, such as cards.

You can also enable or disable individual payment methods, such as Apple Pay or Google Pay. With the Checkout Sessions API, Stripe evaluates the currency and any restrictions, then dynamically presents the supported payment methods to the customer.

For example, Apple Pay is enabled and Google Pay is disabled, by default. In some cases, Stripe might not show these payment methods, even if you enabled them. Stripe doesn’t show Google Pay if you enable automatic tax without collecting a shipping address.

To see how Stripe displays your payment methods to customers, enter a transaction ID or set an order amount and currency in the Dashboard.

Add or remove payment methods in your integration

Enable payment methods for your integration from the payment methods settings in the Dashboard. You can select Turn on to enable some payment methods. For payment methods that require additional steps, select Set up or Review terms.

Learn about which payment methods are right for your business from our payment methods guide.

(Recommended) Handle delayed notification payment methods

The payment method you integrate might have a delayed payment confirmation. If you set up webhooks to automatically fulfill orders, you might need to update your Checkout integration when you add your first payment method that has delayed notifications.

注意

このステップは、Bacs Direct Debit、銀行振込、Boleto、カナダのプレオーソリデビット、コンビニ決済、OXXO、Pay by Bank、SEPA Direct Debit、SOFORT、ACH Direct Debit のうち、いずれかの決済手段の使用を予定している場合にのみ当てはまります

遅延通知型の支払い方法で支払いを受け取る場合、売上はすぐには利用可能になりません。売上の処理までに数日かかることがあるため、売上がアカウントで利用可能になるまで注文のフルフィルメントを保留する必要があります。支払いが成功すると、基本となる PaymentIntent のステータスが processing から succeeded に変わります。

以下の Checkout イベントを処理する必要があります。

イベント名説明次のステップ
checkout.session.completed顧客が Checkout フォームを送信して、デビット支払いのオーソリを正常に完了しました。支払いが成功するか、失敗するかの結果を待ちます。
checkout.session.async_payment_succeeded顧客の支払いが成功しました。顧客の購入商品またはサービスのフルフィルメントを行います。
checkout.session.async_payment_failed何らかの理由により支払いが拒否されたか、失敗しました。顧客にメールで連絡して、新たに注文を行うようリクエストします。

これらのイベントすべてに Checkout Session (Checkout セッション) オブジェクトが含まれます。

イベントハンドラーを更新して、注文のフルフィルメントを実行します。

Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys Stripe.api_key =
'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
# You can find your endpoint's secret in the output of the `stripe listen` # command you ran earlier endpoint_secret = 'whsec_...' post '/webhook' do event = nil # Verify webhook signature and extract the event # See https://stripe.com/docs/webhooks#verify-events for more information. begin sig_header = request.env['HTTP_STRIPE_SIGNATURE'] payload = request.body.read event = Stripe::Webhook.construct_event(payload, sig_header, endpoint_secret) rescue JSON::ParserError => e # Invalid payload return status 400 rescue Stripe::SignatureVerificationError => e # Invalid signature return status 400 end case event['type'] if event['type'] == 'checkout.session.completed' checkout_session = event['data']['object'] fulfill_order(checkout_session) end when 'checkout.session.completed' checkout_session = event['data']['object'] # Save an order in your database, marked as 'awaiting payment' create_order(checkout_session) # Check if the order is already paid (for example, from a card payment) # # A delayed notification payment will have an `unpaid` status, as # you're still waiting for funds to be transferred from the customer's # account. if checkout_session.payment_status == 'paid' fulfill_order(checkout_session) end when 'checkout.session.async_payment_succeeded' checkout_session = event['data']['object'] # Fulfill the purchase... fulfill_order(checkout_session) when 'checkout.session.async_payment_failed' session = event['data']['object'] # Send an email to the customer asking them to retry their order email_customer_about_failed_payment(checkout_session) end status 200 end def fulfill_order(checkout_session) # TODO: fill in with your own logic puts "Fulfilling order for #{checkout_session.inspect}" end def create_order(checkout_session) # TODO: fill in with your own logic puts "Creating order for #{checkout_session.inspect}" end def email_customer_about_failed_payment(checkout_session) # TODO: fill in with your own logic puts "Emailing customer about payment failure for: #{checkout_session.inspect}" end

テスト

stripe listen の実行が続いていることを確認します。前のステップで行ったように、テストユーザーとして Checkout を実行します。イベントハンドラーが checkout.session.completed イベントを受信し、イベントが正常に処理されています。

これですべてのステップを完了しました。いつでも本番環境に移行する準備ができています。

Test your integration

カード番号シナリオテスト方法
カード支払いは成功し、認証は必要とされません。クレジットカード番号と、任意の有効期限、セキュリティコード、郵便番号を使用してクレジットカードフォームに入力します。
カード支払いには認証が必要です。クレジットカード番号と、任意の有効期限、セキュリティコード、郵便番号を使用してクレジットカードフォームに入力します。
カードは、insufficient_funds などの拒否コードで拒否されます。クレジットカード番号と、任意の有効期限、セキュリティコード、郵便番号を使用してクレジットカードフォームに入力します。
UnionPay カードは、13 ~ 19 桁の可変長です。クレジットカード番号と、任意の有効期限、セキュリティコード、郵便番号を使用してクレジットカードフォームに入力します。

実装内容をテストするためのその他の情報については、テストをご覧ください。

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