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

注

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

ACH ダイレクトデビットによる将来の支払いに備えて詳細を保存する

将来の ACH ダイレクトデビットによる支払いに備えて支払い方法の詳細を保存する方法を紹介します。

ページをコピー

You can use the Setup Intents API to collect payment method details in advance, with the final amount or payment date determined later. This is useful for:

  • Saving payment methods to a wallet to streamline future purchases
  • Collecting surcharges after fulfilling a service
  • Starting a free trial for a subscription

注

ACH Direct Debit is a delayed notification payment method, which means that funds aren’t immediately available after payment. A payment typically takes 4 business days to arrive in your account.

Stripe Android SDK はオープンソースであり、詳細なドキュメントが提供されています。

To install the SDK, add stripe-android and financial-connections to the dependencies block of your app/build.gradle file:

build.gradle.kts
Kotlin
plugins { id("com.android.application") } android { ... } dependencies { // ... // Stripe Android SDK implementation("com.stripe:stripe-android:21.12.0") // Include the financial connections SDK to support US bank account as a payment method implementation("com.stripe:financial-connections:21.12.0") // Financial Connections SDK implementation("com.stripe:financial-connections:21.12.0") }

注

SDK の最新リリースおよび過去バージョンの詳細については、GitHub の Releases ページをご覧ください。新しいリリースの公開時に通知を受け取るには、リポジトリのリリースを確認してください。

Stripe の公開可能キーを使用して SDK を設定し、 Application サブクラスなどで、Stripe API へのリクエストを実行できるようにします。

Kotlin
import com.stripe.android.PaymentConfiguration class MyApp : Application() { override fun onCreate() { super.onCreate() PaymentConfiguration.init( applicationContext,
"pk_test_TYooMQauvdEDq54NiTphI7jx"
) } }

注

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

顧客を作成または取得する
推奨
サーバー側

ユーザーがビジネスでアカウントを作成する際に、Customer オブジェクトを作成するか、このユーザーに関連付けられた既存の Customer を取得します。この Customer オブジェクトの ID を、顧客を表す社内の内部表記と関連付けることで、保存されている支払い方法の詳細を後で取得して使用することができます。Financial Connections のリピートユーザーの最適化を有効にするには、Customer にメールアドレスを含めます。

Command Line
cURL
curl https://api.stripe.com/v1/customers \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d email={{CUSTOMER_EMAIL}}

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

A SetupIntent is an object that represents your intent to set up a customer’s payment method for future payments. The SetupIntent tracks the steps of this set-up process.

サーバー側

Create a SetupIntent on your server with payment_method_types set to us_bank_account and specify the Customer’s id.

Financial Connections 手数料の詳細については、料金体系の詳細をご覧ください。

デフォルトでは、銀行口座の支払い情報の収集では、手動の口座番号入力と少額入金の確認のフォールバックオプションを使用し、Financial Connections で顧客のアカウントを即時確認します。Financial Connections を設定し、ACH の実装を最適化するために追加の口座データにアクセスする方法については、Financial Connections に関するドキュメントをご覧ください。たとえば、Financial Connections を使用して、ACH 決済の開始前にアカウントの残高を確認できます。

注

顧客がアカウントを認証した後で、追加データにアクセスを拡張するには、権限を拡張してアカウントを再度関連付ける必要があります。

Command Line
cURL
curl https://api.stripe.com/v1/setup_intents \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d customer={{CUSTOMER_ID}} \ -d "payment_method_types[]"=us_bank_account \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=payment_method \ -d "payment_method_options[us_bank_account][financial_connections][permissions][]"=balances

クライアント側

返された SetupIntent には、client secret が含まれています。これは、SetupIntent オブジェクト全体を渡すことなく安全に設定を完了するために、クライアント側で使用されます。client secret をクライアント側に渡す際は、いくつかの方法を使用できます。

Kotlin
import androidx.appcompat.app.AppCompatActivity class CheckoutActivity : AppCompatActivity() { lateinit var setupIntentClientSecret: String fun startCheckout() { // Request a SetupIntent from your server and store its client secret } }

支払い方法の詳細を収集する
クライアント側

ACH ダイレクトデビットで決済を成功させるには、顧客の氏名と (オプションで) メールアドレスが必要です。アプリで、必要な請求詳細を顧客から収集します。

  • 顧客の氏名 (姓と名)
  • 顧客のメールアドレス

CollectBankAccountConfiguration.USBankAccount を使用し、presentWithSetupIntent を呼び出すために必要なパラメーターを作成します。

決済アクティビティーの onCreate 内で CollectBankAccountLauncher インスタンスを初期化して、結果を処理するためのメソッドを渡します。次に、presentWithSetupIntent を呼び出して銀行口座情報を収集し、PaymentMethod を作成して SetupIntent に関連付けます。

Kotlin
import androidx.appcompat.app.AppCompatActivity class CheckoutActivity : AppCompatActivity() { private lateinit var setupIntentClientSecret: String private lateinit var collectBankAccountLauncher: CollectBankAccountLauncher override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) // Create collector collectBankAccountLauncher = CollectBankAccountLauncher.create( this ) { result: CollectBankAccountResult -> when (result) { is CollectBankAccountResult.Completed -> { val intent = result.response.intent if (intent.status === StripeIntent.Status.RequiresPaymentMethod) { // Customer canceled the Financial Connections modal. Present them with other // payment method type options. } else if (intent.status === StripeIntent.Status.RequiresConfirmation) { // We collected an account - possibly instantly verified, but possibly // manually-entered. Display payment method details and mandate text // to the customer and confirm the intent once they accept // the mandate. } } is CollectBankAccountResult.Cancelled -> { // handle cancellation } is CollectBankAccountResult.Failed -> { // handle error print("Error: ${result.error}") } } } } fun startCheckout() { // ... // Build params val collectParams: CollectBankAccountConfiguration = CollectBankAccountConfiguration.USBankAccount( name, email ) // Calling this method will trigger the Financial Connections modal to be displayed collectBankAccountLauncher.presentWithSetupIntent( publishableKey, setupIntentClientSecret, collectParams ) } }

This loads a modal UI that handles bank account details collection and verification. When it completes, the PaymentMethod automatically attaches to the SetupIntent.

オプションFinancial Connections 銀行口座のデータにアクセスする
サーバー側

同意書承認を収集し送信する
クライアント側

SetupIntent を完了して顧客の支払い方法の詳細を保存する前に、同意書の規約を表示して支払いに対する承認を得る必要があります。

To be compliant with Nacha rules, you must obtain authorization from your customer before you can initiate payment by displaying mandate terms for them to accept. For more information on mandates, see Mandates.

顧客が同意書の規約を承認する際、Setup を確定する必要があります。顧客がフォームを送信したら、confirm を使用して決済を完了します。

Kotlin
class CheckoutActivity : AppCompatActivity() { // ... private lateinit var setupIntentClientSecret: String private val paymentLauncher: PaymentLauncher by lazy { val paymentConfiguration = PaymentConfiguration.getInstance(applicationContext) PaymentLauncher.Companion.create( this, paymentConfiguration.publishableKey, paymentConfiguration.stripeAccountId, ::onPaymentResult ) } private fun startCheckout() { // ... val confirmParams = ConfirmSetupIntentParams.create( clientSecret = setupIntentClientSecret, paymentMethodType = PaymentMethod.Type.USBankAccount ) paymentLauncher.confirm(confirmParams) } private fun onPaymentResult(paymentResult: PaymentResult) { when (paymentResult) { is PaymentResult.Completed -> { // show success UI } is PaymentResult.Canceled -> { // handle cancel flow } is PaymentResult.Failed -> { // handle failures // (for example, the customer might need to choose a new payment // method) } } } }

注

confirm が完了するまでには数秒かかる場合があります。この間、フォームが再送信されないように無効化し、待機中のインジケーター (スピナーなど) を表示します。エラーが発生した場合には顧客に表示して、フォームを再度有効化し、待機中のインジケーターを非表示にします。

成功した場合、Stripe から以下のいずれかのステータスで SetupIntent オブジェクトが返されます。

ステータス説明次のステップ
succeeded銀行口座が即座に確認されたか、確認が不要でした。アクションは不要です
requires_action銀行口座の確認を完了するには、追加のアクションが必要です。Step 6: Verifying bank accounts with microdeposits

After successfully confirming the Setup, an email confirmation of the mandate and collected bank account details must be sent to your customer. Stripe handles these by default, but you can choose to send custom notifications if you prefer.

少額入金で銀行口座を確認する
クライアント側

すべての顧客が銀行口座を即時に確認できるわけではありません。このステップは、顧客が前のステップで即時確認フローからオプトアウトした場合にのみ適用されます。

このような場合、Stripe は descriptor_code による少額入金を送金し、銀行口座の確認でさらに問題が発生した場合には、amount による少額入金に戻る場合があります。これらの入金が顧客のオンライン明細書に表示されるには 1 ~ 2 営業日かかります。

  • 明細書表記コード。Stripe は、SM で始まる一意の 6 桁の descriptor_code を使用し、0.01 USD の 1 件の少額入金を顧客の銀行口座に送金します。顧客は、この文字列を使用して銀行口座を確認します。
  • 金額。Stripe は、ACCTVERIFY という明細書表記を使用し、一意でない 2 件の少額入金を顧客の銀行口座に送金します。顧客は、この入金額を使用して銀行口座を確認します。

The result of the confirmSetupIntent method call in the previous step is a SetupIntent in the requires_action state. The SetupIntent contains a next_action field that contains some useful information for completing the verification.

If you supplied a billing email, Stripe notifies your customer through this email when the deposits are expected to arrive. The email includes a link to a Stripe-hosted verification page where they can confirm the amounts of the deposits and complete verification.

警告

確認の失敗は、明細書表記ベースの少額入金の場合は 10 回、金額ベースの少額入金の場合は 3 回までです。この上限を超えると、Stripe は銀行口座を確認できなくなります。また、少額入金の確認は 10 日経過するとタイムアウトになります。この期間内に少額入金を確認できなかった場合、PaymentIntent は新しい支払い方法の詳細を要求する状態に戻ります。少額入金とは何か、どのように使用されるのかを顧客に明確に伝えることで、確認に関する問題を回避できます。

オプション: カスタムのメール通知を送信する

You can also send custom email notifications to your customer. After you set up custom emails, you need to specify how the customer responds to the verification email. To do so, choose one of the following:

  • Use the Stripe-hosted verification page. To do this, use the verify_with_microdeposits[hosted_verification_url] URL in the next_action object to direct your customer to complete the verification process.

  • Stripe がオンラインで提供する確認ページを使用しない場合には、ご自身のアプリにフォームを作成します。顧客はこのフォームを使用して少額入金の金額を伝え、Android SDK を使用して銀行口座を確認します。

    • 少なくとも descriptor code パラメーター (確認のための 6 桁の文字列) を処理するフォームを設定します。
    • また Stripe では、amounts パラメーターも処理するようにフォームを設定することをお勧めします。これはこのパラメーターが、顧客が利用する一部の銀行で必要とされることがあるためです。

    組み込みは、descriptor_code 「または」 amounts のみを渡します。組み込みでどちらが使用されるかを判断するには、next_action オブジェクトの verify_with_microdeposits[microdeposit_type] の値を確認します。

Kotlin
// Use if you are using a descriptor code, do not use if you are using amounts fun verifySetupIntentWithMicrodeposits( clientSecret: String, descriptorCode: String, callback: ApiResultCallback<PaymentIntent> ) // Use if you are using amounts, do not use if you are using descriptor code fun verifySetupIntentWithMicrodeposits( clientSecret: String, firstAmount: Int, secondAmount: Int, callback: ApiResultCallback<PaymentIntent> )

銀行口座の確認が成功すると、Stripe は、succeeded の status の SetupIntent オブジェクトを返します。

確認が失敗する理由はいくつかあります。失敗は、直接的なエラー応答として同期的に発生します。

{ "error": { "code": "payment_method_microdeposit_verification_amounts_mismatch", "message": "The amounts provided do not match the amounts that were sent to the bank account. You have {attempts_remaining} verification attempts remaining.", "type": "invalid_request_error" } }
エラーコードメッセージステータスの変化
payment_method_microdeposit_failed少額入金に失敗しました。指定した銀行口座、金融機関、支店の番号を確認してください。status は requires_payment_method で、last_setup_error が設定されます。
payment_method_microdeposit_verification_amounts_mismatch指定された金額が銀行口座に送金された金額と一致しません。確認試行の残り回数はあと {attempts_remaining} 回です。変化なし
payment_method_microdeposit_verification_attempts_exceeded許容された確認の試行回数を超えました。status は requires_payment_method で、last_setup_error が設定されます。

組み込みをテストする

Financial Connections を使用して即時確認を行うシナリオをテストする方法をご紹介します。

Send transaction emails in a sandbox

After you collect the bank account details and accept a mandate, send the mandate confirmation and microdeposit verification emails in a sandbox. To do this, provide an email in the payment_method_data.billing_details[email] field in the form of {any-prefix}+test_email@{any_domain} when you collect the payment method details.

よくある間違い

You need to activate your Stripe account before you can trigger these emails while testing.

テスト用口座番号

Stripe では、手動入力の銀行口座の組み込みが本番環境に移行する準備が整ったかどうかを確認するため、テスト用の口座番号と対応するトークンをいくつか用意しています。

口座番号トークン金融番号動作
000123456789pm_usBankAccount_success110000000支払いは成功します。
000111111113pm_usBankAccount_accountClosed110000000口座が解約済みであるため、支払いは失敗します。
000111111116pm_usBankAccount_noAccount110000000口座が見つからないため、支払いは失敗します。
000222222227pm_usBankAccount_insufficientFunds110000000残高不足のため、支払いは失敗します。
000333333335pm_usBankAccount_debitNotAuthorized110000000引き落としがオーソリされていないため、支払いは失敗します。
000444444440pm_usBankAccount_invalidCurrency110000000通貨が無効であるため、支払いは失敗します。
000666666661pm_usBankAccount_failMicrodeposits110000000支払いで少額入金の送金が失敗します。
000555555559pm_usBankAccount_dispute110000000支払いによって不審請求の申請が開始されています。
000000000009pm_usBankAccount_processing110000000支払いは無期限に処理中のままになります。これは PaymentIntent のキャンセルをテストするのに便利です。
000777777771pm_usBankAccount_weeklyLimitExceeded110000000The payment fails due to payment amount causing the account to exceed its weekly payment volume limit.

テスト取引を完了する前に、自動的に支払いに成功または失敗するテスト用のすべての口座を確認する必要があります。確認するには、下記の少額入金のテスト用の金額または明細書表記コードを使用します。

少額入金の金額と明細書表記コードをテストする

さまざまなシナリオを再現するために、これらの少額入金の金額「または」明細書表記コードの値 0.01 を使用します。

少額入金の金額明細書表記コードの値 0.01シナリオ
32 および 45SM11AAアカウントの確認をシミュレーションします。
10 および 11SM33CC許容された確認回数の超過をシミュレーションします。
40 および 41SM44DD少額入金のタイムアウトをシミュレーションします。

Test settlement behavior

Test transactions settle instantly and are added to your available test balance. This behavior differs from livemode, where transactions can take multiple days to settle in your available balance.

将来の決済を受け付ける
サーバー側

When the SetupIntent succeeds, it will create a new PaymentMethod attached to a Customer. These can be used to initiate future payments without having to prompt the customer for their bank account a second time.

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

オプション即時の確認のみ
サーバー側

オプション少額入金のみによる確認
サーバー側

オプションデフォルトの支払い方法を更新する
サーバー側

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