コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
開発者向けのツール
始める
支払い
財務の自動化
始める
支払い
財務の自動化
プラットフォームおよびマーケットプレイス
資金管理
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるManaged Payments
Payment Links を使用する
決済ページを構築
高度なシステムを構築
アプリ内実装を構築
決済手段
決済手段を追加
    概要
    支払い方法の導入オプション
    ダッシュボードで支払い方法を管理
    決済手段のタイプ
    カード
    銀行口座引き落とし
    銀行へのリダイレクト
      Bancontact
      BLIK
      EPS
      FPX
      iDEAL
      Przelewy24
      Sofort
        SOFORT を削除して置き換え
        決済を受け付ける
        支払い中の銀行情報の保存
        将来の支払いを設定する
      TWINT
    銀行振込
    クレジットトランスファー (Sources)
    後払い
    リアルタイム決済
    店舗支払い
    ウォレット
    国ごとに現地の支払い方法を有効化
    カスタムの決済手段
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内 Elements
決済シナリオ
カスタムの決済フロー
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
他の Stripe プロダクト
Financial Connections
仮想通貨
Climate
ホーム支払いAdd payment methodsBank redirectsSOFORT

注

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

Sofort での支払い中に銀行詳細を保存する

Sofort での支払いから顧客の IBAN 銀行詳細を保存する方法をご紹介します。

ページをコピー

警告

SOFORT has been discontinued as of March 31, 2025. For more information, read our support page.

注意

支払い中に支払いの詳細を保存するためのガイドに従うことをお勧めします。すでに Elements との連携が完了している場合は、Payment Element 移行ガイドをご覧ください。

SEPA ダイレクトデビット

Sofort を使用せずに導入するには、SEPA ダイレクトデビットによる決済の受け付けをご覧ください。

Sofort は 1 回限りの使用の、通知遅延型の支払い方法であり、顧客は支払いの認証を求められます。顧客が Sofort で支払う場合は、ウェブサイトから銀行のポータルにリダイレクトされ、そこで支払いの認証を行います。成功または失敗の通知を受け取るまでに、通常 2 〜 14 日かかります。

Sofort を使用して、顧客の IBAN 銀行詳細を SEPA ダイレクトデビット の PaymentMethod に保存できます。その後、SEPA ダイレクトデビット PaymentMethod を使用して、決済を受け付けたり、サブスクリプションを設定したりできます。これにより、顧客が IBAN の入力を繰り返す必要がなくなるため、顧客の負担が軽減されます。また、確認済みの氏名と検証済みの IBAN を受け取ることもできます。

注意

Sofort を使用して SEPA ダイレクトデビットの支払いを設定するには、ダッシュボードで SEPA ダイレクトデビットを有効にする必要があります。また、Sofort 利用規約と SEPA ダイレクトデビット利用規約に従う必要もあります。

Sofort での決済の受け付けは、支払いを追跡するための PaymentIntent (支払いインテント) オブジェクトの作成、支払い方法に関する情報と同意書承認の収集、および支払いを処理するための Stripe への送信で構成されます。Stripe は、PaymentIntent を使用して、支払いが完了するまでの支払いの状態のすべてを追跡して処理します。以降の支払いの PaymentIntent の作成には、最初の Sofort PaymentIntent から収集された SEPA ダイレクトデビット PaymentMethod の ID が使用されます。

Stripe を設定する
サーバー側

まず、Stripe アカウントが必要です。今すぐご登録ください。

アプリケーションから Stripe API にアクセスするには、Stripe の公式ライブラリを使用します。

Command Line
Ruby
# Available as a gem sudo gem install stripe
Gemfile
Ruby
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Customer を作成する
サーバー側

お客様のビジネスで顧客がアカウントを作成する際に、Customer を作成し、それを、そのアカウントを表す独自の内部表記と関連付けます。このようにすると、保存されている支払い方法の詳細を後で取得して使用することができます。

Command Line
cURL
curl -X POST https://api.stripe.com/v1/customers \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

PaymentIntent を作成する
サーバー側

サーバーで PaymentIntent を作成し、回収する amount、eur 通貨、顧客 ID を指定し、Setup future usage (今後の使用の設定) の引数として off_session を指定します。既存の Payment Intents のシステムがある場合は、sofort を payment method types (支払い方法タイプ) のリストに追加します。

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d amount=1099 \ -d currency=eur \ -d "payment_method_types[]"=sofort \ -d customer={{CUSTOMER_ID}} \ -d setup_future_usage=off_session

PaymentIntent には、支払い方法 ID と client secret が含まれています。これは、PaymentIntent オブジェクト全体を渡す代わりに、クライアント側で支払いプロセスを安全に完了するために使用されます。

支払い方法の詳細と同意書承認を収集する
クライアント側

クライアントで支払いフォームを作成し、必要な請求先情報を顧客から収集します。

SEPA ダイレクトデビットの支払いを処理するには、顧客から同意書を収集する必要があります。以下に示す定型の承認用文書を表示し、顧客が黙示的にこの同意書に署名するようにしてください。

「Rocket Rides」はお客様の社名に置き換えます。

Authorization text template

By providing your payment information and confirming this payment, you authorise (A) and Stripe, our payment service provider, to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with those instructions. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited. Your rights are explained in a statement that you can obtain from your bank. You agree to receive notifications for future debits up to 2 days before they occur.

コピー

支払い方法を設定するか、PaymentIntent を確定すると、承認済みの同意書が作成されます。顧客は黙示的に同意書に署名したため、フォームまたはメールを通じて、顧客にこれらの規約を伝える必要があります。

フィールド値
name顧客の氏名。
email顧客のメール。
checkout.html
<form id="payment-form"> <div class="form-row"> <label for="name"> Name </label> <input id="name" name="name" required> </div> <div class="form-row"> <label for="email"> Email </label> <input id="email" name="email" required> </div> <button id="submit-button">Pay with Sofort</button> <!-- Display mandate acceptance text. --> <div id="mandate-acceptance"> By providing your payment information and confirming this payment, you authorise (A) Rocket Rides and Stripe, our payment service provider, to send instructions to your bank to debit your account and (B) your bank to debit your account in accordance with those instructions. As part of your rights, you are entitled to a refund from your bank under the terms and conditions of your agreement with your bank. A refund must be claimed within 8 weeks starting from the date on which your account was debited. Your rights are explained in a statement that you can obtain from your bank. You agree to receive notifications for future debits up to 2 days before they occur. </div> <!-- Used to display form errors. --> <div id="error-message" role="alert"></div> </form>

Stripe に支払いを送信する
クライアント側

PaymentIntent オブジェクト全体をクライアントに送信するのではなく、ステップ 3 の client secret を使用します。これは、Stripe API リクエストを認証する API キーとは異なります。

ただし、client secret は支払いを完了できるため、慎重に取り扱う必要があります。記録したり、URL に埋め込んだり、当該の顧客以外に漏洩することがないようにしてください。

stripe.confirmSofortPayment を使用し、お客様のページからのリダイレクトを処理して支払いを完了します。この機能に return_url を追加して、ユーザーが銀行のウェブサイトまたはモバイルアプリで支払いを完了した後に Stripe がユーザーをリダイレクトする場所を指示します。

payment_method[billing_details] に顧客の氏名とメールアドレスを含めます。これは、SEPA ダイレクトデビット PaymentMethod を生成する際に使用されます。

client.js
var stripe = Stripe(
'pk_test_TYooMQauvdEDq54NiTphI7jx'
); var accountholderName = document.getElementById('name'); var accountholderEmail = document.getElementById('email'); // Redirects away from the client const {error} = await stripe.confirmSofortPayment( '{{PAYMENT_INTENT_CLIENT_SECRET}}', { payment_method: { sofort: { country: "DE" }, billing_details: { name: accountholderName.value, email: accountholderEmail.value, }, }, return_url: 'https://example.com/checkout/complete', } ); if (error) { // Inform the customer that there was an error. }

顧客が支払いを送信すると、Stripe は顧客を return_url にリダイレクトし、以下の URL クエリーパラメーターを含めます。返品ページでは、これらを使用して PaymentIntent のステータスを取得し、顧客に支払いステータスを表示できます。

return_url を指定する際に、返品ページで使用する独自のクエリパラメーターを追加することもできます。

パラメーター説明
payment_intentPaymentIntent の一意の識別子。
payment_intent_client_secretThe client secret of the PaymentIntent object. For subscription integrations, this client_secret is also exposed on the Invoice object through confirmation_secret

顧客が自社のサイトにリダイレクトされたら、payment_intent_client_secret を使用して PaymentIntent をクエリし、顧客に取引ステータスを表示できます。

後日 SEPA ダイレクトデビット PaymentMethod に請求する

顧客に再び請求する必要が生じたときは、新しい PaymentIntent を作成します。以前の PaymentIntent を 取得し、latest_charge フィールドを展開して payment_method_details 内の generated_sepa_debit ID を探すことで、SEPA ダイレクトデビットの支払い方法の ID を見つけます。

Command Line
cURL
curl -G https://api.stripe.com/v1/payment_intents/{{PAYMENT_INTENT_ID}} \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "expand[]"=latest_charge

SEPA ダイレクトデビットの支払い方法 ID は、レスポンス内の payment_method_details にある generated_sepa_debit ID になります。

{ "latest_charge": { "payment_method_details": { "sofort": { "bank_code": "VAPE", "bank_name": "VAN DE PUT & CO", "bics": "VAPEBE22", "iban_last4": "7061", "generated_sepa_debit": "pm_1GrddXGf98efjktuBIi3ag7aJQ", "preferred_language": "en", "verified_name": "Jenny Rosen" }, "type": "sofort" }, }, "payment_method_options": { "sofort": {}

SEPA ダイレクトデビットと顧客 ID を使用して PaymentIntent を作成します。

Command Line
cURL
curl https://api.stripe.com/v1/payment_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "payment_method_types[]"=sepa_debit \ -d amount=1099 \ -d currency=eur \ -d customer=
{{CUSTOMER_ID}}
\ -d payment_method={{SEPA_DEBIT_PAYMENT_METHOD_ID}} \ -d confirm=true

導入をテストする

payment_method.billing_details.emailを以下の値のいずれかに設定して PaymentMethod のステータスの移行をテストします。メールアドレスの先頭に独自のカスタムのテキストを含め、その後ろにアンダースコアを付けることができます。 たとえば、test_1_generatedSepaDebitIntentsFail@example.com は、PaymentIntent とともに使用された場合に常に失敗する、SEPA ダイレクトデビットの PaymentMethod です。

メールアドレス説明
generatedSepaDebitIntentsSucceedAustria@example.comSEPA ダイレクトデビットの PaymentIntent ステータスが processing から succeeded に移行します。
generatedSepaDebitIntentsSucceedDelayedAustria@example.comThe SEPA Direct Debit PaymentIntent status transitions from processing to succeeded after at least three minutes.
generatedSepaDebitIntentsFailAustria@example.comSEPA ダイレクトデビットの PaymentIntent ステータスが processing から requires_payment_method に移行します。
generatedSepaDebitIntentsFailDelayedAustria@example.comThe SEPA Direct Debit PaymentIntent status transitions from processing to requires_payment_method after at least three minutes.
generatedSepaDebitIntentsSucceedDisputedAustria@example.comSEPA ダイレクトデビットの PaymentIntent のステータスが processing から succeeded に移行しますが、すぐに不審請求の申請が作成されます。

支払い後のイベントを処理する

As Sofort is a delayed notification payment method, the PaymentIntent’s status remains in a payment_intent.processing state for up to 14 days from its creation (also known as the cutoff date). In a sandbox, the PaymentIntent’s status remains in the processing state for three minutes to simulate this.

  • Stripe では、処理中の状態の間に購入をフルフィルメントすることをお勧めします。平均して、処理中状態に入った後に Sofort の支払い試行が失敗する確率は 0.2% と予測されます。この方法は、Sofort の支払いの失敗率が低い Sofort にのみ適用でき、他の遅延通知型の支払い方法には適用できません。
  • 必要に応じて、payment_intent.succeeded イベントを受け取った後にのみ注文をフルフィルメントすることもできます。Stripe では、支払いが確定され、売上が保証された後でこのイベントを送信します。
  • 顧客が支払いを行わない場合、Stripe は payment_intent.failed イベントを送信し、PaymentIntent は requires_payment_method ステータスに戻ります。

ダッシュボード、カスタム Webhook、またはパートナーソリューションを使用して、これらのイベントを受信し、顧客への注文確認メールの送信、データベースへの売上の記録、配送ワークフローの開始などのアクションを実行します。

手動

Stripe ダッシュボードは、すべての Stripe での支払いの確認、メール領収書の送信、入金処理、または失敗した支払いの再試行に使用できます。

  • ダッシュボードでテスト支払いを確認する

カスタムコード

Webhook ハンドラを作成してイベントをリッスンし、非同期型のカスタムの支払いフローを作成します。Stripe CLI を使用して、ローカルで Webhook 組み込みのテストとデバッグを行います。

  • カスタム Webhook を作成する

事前構築のアプリ

オートメーションやマーケティングとセールスなどの一般的なビジネスイベントを、パートナーアプリケーションとの連携によって処理します。

オプションSofort リダイレクトを手動で処理する

参照情報

  • SEPA ダイレクトデビット決済を受け付ける
  • EU での SEPA ダイレクトデビットによるサブスクリプションを設定する
このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc