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

注

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

SEPA ダイレクトデビットによる支払いを受け付ける

SEPA ダイレクトデビット支払いの受け付けについて説明します。

ページをコピー

注意

サーバー側での手動確定を使用する必要がある場合、またはお使いの実装で決済手段を別途表示する必要がある場合を除き、決済を受け付けるガイドに従うことをお勧めします。すでに Elements との連携が完了している場合は、Payment Element 移行ガイドをご覧ください。

Web サイトでの SEPA ダイレクトデビット支払いの受け付けは、支払いを追跡するオブジェクトの作成、支払い方法に関する情報と同意書承認の収集、および支払いを処理するための Stripe への支払いの送信で構成されます。Stripe はこの PaymentIntent と呼ばれる支払いオブジェクトを使用して、支払いが完了するまで、支払いのすべての状態の追跡と処理を行います。

SEPA ダイレクトデビットの PaymentMethod は、顧客に Bancontact、iDEAL、または Sofort を使用した銀行情報の認証を依頼することによっても設定できます。

Stripe を設定する
サーバ側
クライアント側

サーバ側

この組み込みには、Stripe API と通信するエンドポイントがサーバ上に必要です。Stripe の公式ライブラリを使用して、サーバから Stripe API にアクセスします。

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'

クライアント側

React Native SDK はオープンソースであり、詳細なドキュメントが提供されています。内部では、ネイティブの iOS および Android の SDK を使用します。Stripe の React Native SDK をインストールするには、プロジェクトのディレクトリーで (使用するパッケージマネージャーによって異なる) 次のいずれかのコマンドを実行します。

Command Line
yarn add @stripe/stripe-react-native

次に、その他の必要な依存関係をインストールします。

  • iOS の場合は、ios ディレクトリーに移動して pod install を実行し、必要なネイティブ依存関係もインストールします。
  • Android の場合は、依存関係をインストールする必要はありません。

Stripe の初期化

React Native アプリで Stripe を初期化するには、決済画面を StripeProvider コンポーネントでラップするか、initStripe 初期化メソッドを使用します。publishableKey の API 公開可能キーのみが必要です。次の例は、StripeProvider コンポーネントを使用して Stripe を初期化する方法を示しています。

import React, { useState, useEffect } from 'react'; import { StripeProvider } from '@stripe/stripe-react-native'; function App() { const [publishableKey, setPublishableKey] = useState(''); const fetchPublishableKey = async () => { const key = await fetchKey(); // fetch key from your server here setPublishableKey(key); }; useEffect(() => { fetchPublishableKey(); }, []); return ( <StripeProvider publishableKey={publishableKey} merchantIdentifier="merchant.identifier" // required for Apple Pay urlScheme="your-url-scheme" // required for 3D Secure and bank redirects > // Your app code here </StripeProvider> ); }

注

Use your API test keys while you test and develop, and your live mode keys when you publish your app.

Customer を作成または取得する
サーバ側

以降の支払いに SEPA ダイレクトデビットの口座を再利用するには、その口座を Customer に関連付ける必要があります。

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

新しい Customer を作成するか、または既存の Customer を取得して、この支払いに関連付けます。サーバに以下のコードを含め、新しい Customer を作成します。

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

PaymentIntent を作成する
サーバ側
クライアント側

サーバ側

PaymentIntent (支払いインテント) は、顧客から支払いを回収する意図を表すオブジェクトであり、支払いプロセスのライフサイクルの各段階を追跡します。まず、サーバーで PaymentIntent を作成し、回収する金額と eur 通貨を指定します (SEPA ダイレクトデビットは他の通貨には対応していません)。すでに Payment Intents API を使用したシステムがある場合は、sepa_debit を PaymentIntent の支払い方法タイプのリストに追加します。Customer の id を指定します。

再利用するために SEPA ダイレクトデビットの口座を保存するには、setup_future_usage パラメーターを off_session に設定します。SEPA ダイレクトデビットはこのパラメーターの値として off_session のみを受け付けます。

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

クライアント側

クライアント側で、サーバーの PaymentIntent をリクエストし、その client secret を保存します。

const fetchPaymentIntentClientSecret = async () => { const response = await fetch(`${API_URL}/create-payment-intent`, { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ email, currency: 'eur', payment_method_types: ['sepa_debit'], }), }); const {clientSecret, error} = await response.json(); return {clientSecret, error}; };

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

決済フォームで顧客の IBAN を収集し、顧客が黙示的にこの同意書に署名するように以下の標準オーソリテキストを表示します。

以下に示す定型の承認用文書を表示し、顧客が黙示的にこの同意書に署名するようにしてください。

「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 を確定すると、承認済みの同意書が作成されます。顧客は黙示的に同意書に署名したため、フォームまたはメールを通じて、顧客にこれらの規約を伝える必要があります。

export default function SepaPaymentScreen() { const [email, setEmail] = useState(''); const [iban, setIban] = useState(''); return ( <Screen> <TextInput placeholder="E-mail" keyboardType="email-address" onChange={(value) => setEmail(value.nativeEvent.text)} style={styles.input} /> <TextInput placeholder="Iban" onChange={(value) => setIban(value.nativeEvent.text.toLowerCase())} style={styles.input} /> <Button variant="primary" onPress={handlePayPress} title="Save IBAN" loading={loading} /> </Screen> ); }

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

作成した PaymentIntent から client secret を取得し、confirmPayment を呼び出します。

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

注

IBAN に国コード AD、PF、TF、GI、GB、GG、VA、IM、JE、MC、NC、BL、PM、SM、CH、WF が含まれる場合は、billingDetails に addressCountry と addressLine1 を指定する必要があります。住所フィールドの一覧については、React Native SDK リファレンスをご覧ください。

export default function SepaPaymentScreen() { const [iban, setIban] = useState(''); const {confirmPayment, loading} = useConfirmPayment(); const handlePayPress = async () => { const { clientSecret, error: clientSecretError, } = await fetchPaymentIntentClientSecret(); if (clientSecretError) { Alert.alert(`Error`, clientSecretError); return; } const billingDetails: PaymentMethodCreateParams.BillingDetails = { name: 'Jenny Rosen', email: 'jenny.rosen@example.com', }; const {error, paymentIntent} = await confirmPayment(clientSecret, { paymentMethodType: 'SepaDebit', paymentMethodData: { billingDetails, iban, }, }); if (error) { Alert.alert(`Error code: ${error.code}`, error.message); } else if (paymentIntent) { if (paymentIntent.status === PaymentIntents.Status.Processing) { Alert.alert( 'Processing', `The debit has been successfully submitted and is now processing.`, ); } else if (paymentIntent.status === PaymentIntents.Status.Succeeded) { Alert.alert( 'Success', `The payment was confirmed successfully! currency: ${paymentIntent.currency}`, ); } else { Alert.alert('Payment status:', paymentIntent.status); } } }; return <Screen>{/* ... */}</Screen>; }

PaymentIntent の成功を確認する

SEPA ダイレクトデビットは、通知遅延型の支払い方法であるため、売上はすぐに利用可能にはなりません。支払いが正常に送信されると、PaymentIntent のステータスが requires_confirmation から processing に更新されます。支払いが成功すると、PaymentIntent のステータスが processing から succeeded に更新されます。

PaymentIntent のステータスが更新されると、以下のイベントが送信されます。

イベント説明次のステップ
payment_intent.processing顧客の支払いは、Stripe に正常に送信されました。開始された支払いの成功、または失敗の結果を待ちます。
payment_intent.succeeded顧客の決済が成功しました。顧客が購入した商品またはサービスのフルフィルメントを行います。
payment_intent.payment_failed顧客の支払いが拒否されました。Contact the customer through email or push notification and request another payment method.

支払いが成功したことを確認し、顧客に支払い完了を通知するには、Webhook を使用することをお勧めします。

setup_future_usage および customer が設定されているため、支払いが processing 状態になると、PaymentMethod が Customer オブジェクトに関連付けられることに注意してください。この関連付けは、支払いが最終的に成功するか、失敗するかには関係なく行われます。

組み込みをテストする

SEPA ダイレクトデビットのテスト用アカウント番号を confirmSepaDebitPayment リクエストで使用することにより、フォームをテストできます。

オプションCustomize mandate references with a prefix

参照情報

  • 今後の支払いのために SEPA ダイレクトデビットの詳細を保存する
  • Connect での支払い
このページはお役に立ちましたか。
はいいいえ
お困りのことがございましたら 、サポートにお問い合わせください。
早期アクセスプログラムにご参加ください。
変更ログをご覧ください。
ご不明な点がございましたら、お問い合わせください。
LLM ですか?llms.txt を読んでください。
Powered by Markdoc