# 銀行振込を受け付ける Payment Intents API を使用して、銀行振込による支払いを受け付けます。 実装で請求書を使用する場合は、[銀行振込の指示を含む請求書の送信](https://docs.stripe.com/invoicing/bank-transfer.md)を参照してください。 顧客からの銀行振込による決済を初めて受け付ける際に、Stripe はその顧客用に仮想銀行口座を生成します。この口座は、顧客と直接共有できます。この顧客からの以降のすべての銀行振込による支払いは、この銀行口座に送金する必要があります。一部の国では、Stripe は、一意の送金照会番号も提供します。未払いの支払いと振込の照合を簡単にするため、顧客は各振込にこの番号を含める必要があります。国によっては、無料で作成できる仮想銀行口座番号の数に制限があります。 ![](https://b.stripecdn.com/docs-statics-srv/assets/without-invoices-diagram-1.49f7cde37ea5ffaf0fea278acbc2b9c8.svg) 銀行振込による支払いの概要 ## 支払い不足と過払いを処理する 銀行振込による決済では、顧客の振込額が予想される決済金額よりも多い場合や少ない場合があります。顧客の振込額が少ない場合、Stripe は、未払いの Payment Intent に部分的に資金を充当します。請求書に部分的に資金が充当されることはありません。入金された資金によって請求額の全額が支払われるまで、請求書は未払いのままになります。 顧客から予想される金額よりも多く振り込まれた場合、Stripe は、未払いの決済に対して入金された資金の照合を試行し、残りの超過額を顧客の残高に保持します。[照合処理](https://docs.stripe.com/payments/customer-balance/reconciliation.md) の詳細をご覧ください。 ![](https://b.stripecdn.com/docs-statics-srv/assets/without-invoices-diagram-2.5a500b70917ee9f5a5630e442bd2c4e6.svg) ![](https://b.stripecdn.com/docs-statics-srv/assets/without-invoices-diagram-3.2b20d27f7fc2208ed31cc95eab9de868.svg) ## 複数の未払いの支払いまたは請求書を処理する 銀行振込で支払うことができる未払いの支払いや請求書が複数ある場合があります。デフォルトの設定の場合、Stripe が振込の参照コードや送金額などの情報を使用して、銀行振込の[自動消し込み](https://docs.stripe.com/payments/customer-balance/reconciliation.md)を試行します。 自動消し込みを無効にして、支払いと請求書を[手動で消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md#cash-manual-reconciliation)ことができます。[reconciliation mode (消し込みモード)](https://docs.stripe.com/api/customers/create.md#create_customer-cash_balance-settings-reconciliation_mode) を manual に設定すると、顧客ごとに自動消し込み動作を上書きできます。 # Elements ## Stripe を設定する [サーバー側] まず、Stripe アカウントが必要です。[今すぐ登録](https://dashboard.stripe.com/register)してください。 アプリケーションから Stripe API にアクセスするには、Stripe の公式ライブラリを使用します。 #### Ruby ```bash # Available as a gem sudo gem install stripe ``` ```ruby # If you use bundler, you can add this line to your Gemfile gem 'stripe' ``` ## 顧客を作成または取得する [サーバー側] 各銀行振込決済を照合するには、顧客を表すオブジェクトを関連付ける必要があります。既存の顧客がいる場合は、この手順をスキップできます。そうでない場合は、新しい顧客を作成します。 > #### Accounts v2 API を使用した顧客の表現 > > Accounts v2 API では、Connect ユーザーには一般提供され、その他の Stripe ユーザーには公開プレビューで提供されます。Accounts v2 プレビューの一部である場合は、コードで[プレビューバージョン](https://docs.stripe.com/api-v2-overview.md#sdk-and-api-versioning)を指定する必要があります。 > > Accounts v2 のプレビューに参加するには、ダッシュボードの [Account previews and features](https://dashboard.stripe.com/settings/previews) に移動して、**Global Payouts の再利用可能な決済手段**を有効にします。 > > ほとんどのユースケースでは、[Customer](https://docs.stripe.com/api/customers.md) オブジェクトを使用するのではなく、[顧客を顧客設定済みの Account オブジェクトとしてモデル化する](https://docs.stripe.com/accounts-v2/use-accounts-as-customers.md)ことをお勧めします。 顧客がビジネスでアカウントを作成するとき、または決済手段を保存するときに、顧客設定の [Account](https://docs.stripe.com/api/v2/core/accounts/create.md#v2_create_accounts-configuration-customer) または [Customer](https://docs.stripe.com/api/customers/create.md) を作成する。オブジェクトの ID を、顧客を表す独自の内部表現に関連付ける。 この決済に関連付ける新しい顧客を作成するか、既存の顧客を取得する。 #### Accounts v2 ```curl curl -X POST https://api.stripe.com/v2/core/accounts \ -H "Authorization: Bearer <>" \ -H "Stripe-Version: 2026-06-24.preview" \ --json '{ "contact_email": "jenny.rosen@example.com", "display_name": "Jenny Rosen", "configuration": { "customer": {} }, "include": [ "configuration.customer" ] }' ``` #### Customers v1 ```curl curl https://api.stripe.com/v1/customers \ -u "<>:" \ -d "name=Jenny Rosen" \ --data-urlencode "email=jenny.rosen@example.com" ``` ## PaymentIntent を作成する [サーバー側] [PaymentIntent](https://docs.stripe.com/api/payment_intents/object.md) は、顧客から決済を回収する意図を表すオブジェクトで、決済プロセスの各段階を通じたライフサイクルを追跡します。サーバーで `PaymentIntent` を作成し、回収する金額と通貨を指定します。また、`PaymentIntent` 作成リクエストの [customer](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-customer) または [customer_account](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-customer_account) パラメーターも設定する必要があります。関連付けられた顧客がない `PaymentIntents` では、銀行振込は利用できません。 #### ダッシュボードで支払い方法を管理する Payment Intent を作成する前に、ダッシュボードの[支払い方法の設定](https://dashboard.stripe.com/settings/payment_methods)ページで、**銀行振込**を有効にしていることを確認します。 > [動的な支払い方法](https://docs.stripe.com/payments/payment-methods/dynamic-payment-methods.md)の場合、Stripe は取引額、通貨、決済フローなどの要素に基づいて、適切な支払い方法が返されるように処理します。 #### Accounts v2 #### US ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d currency=usd \ -d "automatic_payment_methods[enabled]=true" ``` #### UK ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d currency=gbp \ -d "automatic_payment_methods[enabled]=true" ``` #### EU ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d currency=eur \ -d "automatic_payment_methods[enabled]=true" ``` 顧客に表示される IBAN をローカライズするには、[`identity.individual.address`](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-identity-individual-address) プロパティを設定するか、[ダッシュボードで Account を編集](https://docs.stripe.com/invoicing/customer.md#edit-a-customer)してください。 Stripe では の IBAN ローカライゼーションに対応しています。 - 顧客の国が設定されていない場合、またはその国が IBAN のローカライズに対応していない場合は、Stripe アカウントの国が使用されます。 - IBAN のローカライゼーションが Stripe アカウントの国でサポートされていない場合、`IE` に戻されます。 > 現在、スペイン (ES) では、ローカライズされた仮想銀行口座番号を新規作成できません。代わりに、他の EU VBAN 加盟国を使用してください。 #### JP ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=19000 \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d currency=jpy \ -d "automatic_payment_methods[enabled]=true" \ --data-urlencode "return_url=https://example.com/return_url" ``` #### MX ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d currency=mxn \ -d "automatic_payment_methods[enabled]=true" \ --data-urlencode "return_url=https://example.com/return_url" ``` #### Customers v1 #### US ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer={{CUSTOMER_ID}}" \ -d currency=usd \ -d "automatic_payment_methods[enabled]=true" ``` #### UK ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer={{CUSTOMER_ID}}" \ -d currency=gbp \ -d "automatic_payment_methods[enabled]=true" ``` #### EU ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer={{CUSTOMER_ID}}" \ -d currency=eur \ -d "automatic_payment_methods[enabled]=true" ``` 顧客に表示される IBAN を各地域に合わせるには、[`address.country`](https://docs.stripe.com/api/customers/object.md#customer_object-address-country) プロパティを設定するか、[ダッシュボードで顧客を編集](https://docs.stripe.com/invoicing/customer.md#edit-a-customer)して、顧客の国を設定できます。 Stripe では の IBAN ローカライゼーションに対応しています。 - 顧客に国を設定していない場合、または顧客の国が IBAN コードに対応していない場合は、Stripe アカウントの国に戻されます。 - IBAN のローカライゼーションが Stripe アカウントの国でサポートされていない場合、`IE` に戻されます。 > 現在、スペイン (ES) では、ローカライズされた仮想銀行口座番号を新規作成できません。代わりに、他の EU VBAN 加盟国を使用してください。 #### JP ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=19000 \ -d "customer={{CUSTOMER_ID}}" \ -d currency=jpy \ -d "automatic_payment_methods[enabled]=true" \ --data-urlencode "return_url=https://example.com/return_url" ``` #### MX ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d "customer={{CUSTOMER_ID}}" \ -d currency=mxn \ -d "automatic_payment_methods[enabled]=true" \ --data-urlencode "return_url=https://example.com/return_url" ``` 最新バージョンの API では、`automatic_payment_methods` パラメーターがデフォルトで有効になっているため、機能の指定は任意です。 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 #### 支払い方法を手動でリスト化する API を使用して手動で決済手段を指定するには、顧客が設定した [Account](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-id) または [Customer](https://docs.stripe.com/api/customers/object.md#customer_object-id) の ID を指定します。 #### Accounts v2 #### US ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=usd \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=us_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `us_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 #### UK ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=gbp \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=gb_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `gb_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 #### EU ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=eur \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=eu_bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][eu_bank_transfer][country]=FR" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `eu_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 - [payment_method_options[customer_balance][bank_transfer][eu_bank_transfer][country]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-eu_bank_account-country) を のいずれかに設定します。顧客に表示される IBAN は、選択した国に合わせて適応されます。 > 現在、スペイン (ES) では、ローカライズされた仮想銀行口座番号を新規作成できません。代わりに、他の EU VBAN 加盟国を使用してください。 #### JP ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=19000 \ -d currency=jpy \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=jp_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `jp_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 #### MX ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=mxn \ -d "customer_account={{CUSTOMERACCOUNT_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=mx_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `mx_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 #### Customers v1 #### US ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=usd \ -d "customer={{CUSTOMER_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=us_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `us_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 #### UK ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=gbp \ -d "customer={{CUSTOMER_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=gb_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `gb_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 #### EU ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=eur \ -d "customer={{CUSTOMER_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=eu_bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][eu_bank_transfer][country]=FR" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `eu_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 - [payment_method_options[customer_balance][bank_transfer][eu_bank_transfer][country]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-eu_bank_account-country) を のいずれかに設定します。顧客に表示される IBAN は、選択した国に合わせて適応されます。 > 現在、スペイン (ES) では、ローカライズされた仮想銀行口座番号を新規作成できません。代わりに、他の EU VBAN 加盟国を使用してください。 #### JP ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=19000 \ -d currency=jpy \ -d "customer={{CUSTOMER_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=jp_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `jp_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 #### MX ```curl curl https://api.stripe.com/v1/payment_intents \ -u "<>:" \ -d amount=1099 \ -d currency=mxn \ -d "customer={{CUSTOMER_ID}}" \ -d "payment_method_types[]=customer_balance" \ -d "payment_method_options[customer_balance][funding_type]=bank_transfer" \ -d "payment_method_options[customer_balance][bank_transfer][type]=mx_bank_transfer" ``` 支払い額に充当できる金額が顧客の残高に十分にある場合、PaymentIntent は `succeeded` ステータスで即座に成功します。顧客が誤って取引に対して過払いをした場合 (銀行振込の場合によく発生します)、差額が生じることがあります。[お客様の所在地に基づいて一定期間内に顧客の残高を消し込む](https://docs.stripe.com/payments/customer-balance/reconciliation.md)必要があります。 - [funding_type](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-funding_type) として `bank_transfer` を使用することで、顧客に支払い金額に対応できるだけの十分な残高がない場合の対処方法を指定します。 - [bank_transfer[type]](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-payment_method_options-customer_balance-bank_transfer-type) として `mx_bank_transfer` を使用することで、支払いの実行に使用できる銀行振込タイプを指定します。 > 支払いを作成するときは必ず、`payment_method_types` を指定します。[将来の支払い](https://docs.stripe.com/payments/save-and-reuse.md)には `customer_balance` を使用することはできません。 ## 支払いの詳細を収集する [クライアント側] [Payment Element](https://docs.stripe.com/payments/payment-element.md) を使用してクライアント側で支払い詳細を収集します。Payment Element は事前構築された UI コンポーネントであり、さまざまな決済手段の詳細の収集をシンプルにします。 Payment Element には、HTTPS 接続を介して支払い情報を Stripe に安全に送信する iframe が含まれています。一部の支払い方法では、支払いを確定するために別のページにリダイレクトする必要があるため、Payment Element を別の iframe 内に配置しないでください。 iframe を使用して Apple Pay または Google Pay を受け付けたい場合は、iframe の [allow](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#attr-allowpaymentrequest) 属性を `"payment *"` と等しく設定する必要があります。 構築済みのシステムを機能させるには、決済ページのアドレスの先頭を `http://` ではなく `https://` にする必要があります。HTTPS を使用しなくてもシステムをテストできますが、本番環境で決済を受け付ける準備が整ったら、必ず、HTTPS を[有効](https://docs.stripe.com/security/guide.md#tls)にしてください。 #### HTML + JS ### Stripe.js を設定する Payment Element は Stripe.js の機能として自動的に使用できるようになります。決済ページに Stripe.js スクリプトを含めるには、HTML ファイルの `head` にスクリプトを追加します。常に js.stripe.com から Stripe.js を直接読み込むことにより、PCI 準拠が維持されます。スクリプトをバンドルに含めたり、そのコピーを自身でホストしたりしないでください。 ```html Checkout ``` 決済ページで以下の JavaScript を使用して、Stripe のインスタンスを作成します。 ```javascript // Set your publishable key: remember to change this to your live publishable key in production // See your keys here: https://dashboard.stripe.com/apikeys const stripe = Stripe('<>'); ``` ### Payment Element を支払いページに追加する Payment Element を決済ページに配置する場所が必要です。決済フォームで、一意の ID を持つ空の DOM ノード (コンテナー) を作成します。 ```html
``` 前のフォームが読み込まれたら、Payment Element のインスタンスを作成して、それをコンテナーの DOM ノードにマウントします。[Elements](https://docs.stripe.com/js/elements_object/create) インスタンスを作成する際に、前のステップからの [client secret](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-client_secret) を `options` に渡します。 client secret は支払いを完了できるため、慎重に取り扱う必要があります。記録したり、URL に埋め込んだり、当該の顧客以外に漏洩することがないようにしてください。 ```javascript const options = { clientSecret: '{{CLIENT_SECRET}}', // Fully customizable with appearance API. appearance: {/*...*/}, }; // Set up Stripe.js and Elements to use in checkout form, passing the client secret obtained in a previous stepconst elements = stripe.elements(options); // Create and mount the Payment Element const paymentElementOptions = { layout: 'accordion'}; const paymentElement = elements.create('payment', paymentElementOptions); paymentElement.mount('#payment-element'); ``` #### React ### Stripe.js を設定する 次の npm パブリックレジストリーから [React Stripe.js](https://www.npmjs.com/package/@stripe/react-stripe-js) と [Stripe.js ローダー](https://www.npmjs.com/package/@stripe/stripe-js)をインストールします。 ```bash npm install --save @stripe/react-stripe-js @stripe/stripe-js ``` ### Elements プロバイダーを支払いページに追加して設定する Payment Element コンポーネントを使用するには、決済ページコンポーネントを [Elements プロバイダー](https://docs.stripe.com/sdks/stripejs-react.md#elements-provider)でラップします。公開キーを使用して `loadStripe` を呼び出し、返された `Promise` を `Elements` プロバイダーに渡します。加えて、前のステップの [client secret](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-client_secret) を `options` にして `Elements` プロバイダーに渡します。 ```jsx import React from 'react'; import ReactDOM from 'react-dom'; import {Elements} from '@stripe/react-stripe-js'; import {loadStripe} from '@stripe/stripe-js'; import CheckoutForm from './CheckoutForm'; // Make sure to call `loadStripe` outside of a component's render to avoid // recreating the `Stripe` object on every render. const stripePromise = loadStripe('<>'); function App() { const options = { // passing the client secret obtained in step 3 clientSecret: '{{CLIENT_SECRET}}', // Fully customizable with appearance API. appearance: {/*...*/}, }; return ( ); }; ReactDOM.render(, document.getElementById('root')); ``` ### Payment Element コンポーネントを追加する `PaymentElement` コンポーネントを使用して、フォームを構築します。 ```jsx import React from 'react'; import {PaymentElement} from '@stripe/react-stripe-js'; const CheckoutForm = () => { return (
); }; export default CheckoutForm; ``` Stripe Elements は、ドロップイン UI コンポーネントのコレクションです。フォームをさらにカスタマイズしたり、その他の顧客情報を収集したりする場合は、[Elements のドキュメント](https://docs.stripe.com/payments/elements.md)をご覧ください。 Payment Element によって動的なフォームが表示され、顧客はここで支払い方法を選択できます。支払い方法ごとに、フォームでは、必要な支払いの詳細のすべてを入力するように顧客に自動的に求めます。 ### デザインをカスタマイズする `Elements` プロバイダーを作成する際に、[Appearance (デザイン) オブジェクト](https://docs.stripe.com/js/elements_object/create#stripe_elements-options-appearance)を `options` に渡すことで、サイトのデザインに合わせて Payment Element をカスタマイズできます。 ### 住所を収集 デフォルトでは、Payment Element は必要な請求住所の詳細のみを収集します。[税金の計算](https://docs.stripe.com/api/tax/calculations/create.md)、配送先情報を入力するなどの一部の動作では、顧客の完全な住所が必要です。次のように対応できます。 - [Address Element](https://docs.stripe.com/elements/address-element.md) を使用して、オートコンプリートとローカリゼーションの機能を利用して、顧客の完全な住所を収集します。これにより、最も正確な税金計算が可能になります。 - 独自のカスタムフォームを使用して住所の詳細を収集する。 確定されると、Stripe は顧客に銀行振込の詳細を表示するモーダルを自動的に開きます。 ## Stripe に支払いを送信する [クライアント側] Payment Element からの詳細を指定して [stripe.confirmPayment](https://docs.stripe.com/js/payment_intents/confirm_payment) を使用し、支払いを完了します。ユーザーが支払いを完了した後に Stripe がユーザーをリダイレクトする場所を指定するには、この関数に [return_url](https://docs.stripe.com/api/payment_intents/create.md#create_payment_intent-return_url) を指定します。ユーザーはまず、銀行のオーソリページなどの中間サイトにリダイレクトされ、その後 `return_url` にリダイレクトされます。カード支払いでは、支払いが正常に完了するとすぐに `return_url` にリダイレクトします。 カード決済で支払いの完了後にリダイレクトを行わない場合は、[redirect](https://docs.stripe.com/js/payment_intents/confirm_payment#confirm_payment_intent-options-redirect) に `if_required` を設定できます。これで、リダイレクトベースの決済手段で購入する顧客のみがリダイレクトされます。 #### HTML + JS ```javascript const form = document.getElementById('payment-form'); form.addEventListener('submit', async (event) => { event.preventDefault(); const {error} = await stripe.confirmPayment({ //`Elements` instance that was used to create the Payment Element elements, confirmParams: { return_url: 'https://example.com/order/123/complete', }, }); if (error) { // This point will only be reached if there is an immediate error when // confirming the payment. Show error to your customer (for example, payment // details incomplete) const messageContainer = document.querySelector('#error-message'); messageContainer.textContent = error.message; } else { // Your customer will be redirected to your `return_url`. For some payment // methods like iDEAL, your customer will be redirected to an intermediate // site first to authorize the payment, then redirected to the `return_url`. } }); ``` #### React 支払いフォームコンポーネントから [stripe.confirmPayment](https://docs.stripe.com/js/payment_intents/confirm_payment) を呼び出すには、[useStripe](https://docs.stripe.com/sdks/stripejs-react.md#usestripe-hook) フックと [useElements](https://docs.stripe.com/sdks/stripejs-react.md#useelements-hook) フックを使用します。 フックではなく従来のクラスコンポーネントを使用する場合は、代わりに [ElementsConsumer](https://docs.stripe.com/sdks/stripejs-react.md#elements-consumer) を使用します。 ```jsx import React, {useState} from 'react'; import {useStripe, useElements, PaymentElement} from '@stripe/react-stripe-js'; const CheckoutForm = () => { const stripe = useStripe(); const elements = useElements(); const [errorMessage, setErrorMessage] = useState(null); const handleSubmit = async (event) => { // We don't want to let default form submission happen here, // which would refresh the page. event.preventDefault(); if (!stripe || !elements) { // Stripe.js hasn't yet loaded. // Make sure to disable form submission until Stripe.js has loaded. return; } const {error} = await stripe.confirmPayment({ //`Elements` instance that was used to create the Payment Element elements, confirmParams: { return_url: 'https://example.com/order/123/complete', }, }); if (error) { // This point will only be reached if there is an immediate error when // confirming the payment. Show error to your customer (for example, payment // details incomplete) setErrorMessage(error.message); } else { // Your customer will be redirected to your `return_url`. For some payment // methods like iDEAL, your customer will be redirected to an intermediate // site first to authorize the payment, then redirected to the `return_url`. } }; return (
{/* Show error message to your customers */} {errorMessage &&
{errorMessage}
} ); }; export default CheckoutForm; ``` `return_url` が、Web サイト上の支払いステータスを表示するページと対応していることを確認します。Stripe が顧客を `return_url` にリダイレクトするときは、以下の URL クエリーパラメーターが指定されます。 | パラメーター | 説明 | | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- | | `payment_intent` | `PaymentIntent` の一意の識別子。 | | `payment_intent_client_secret` | `PaymentIntent` オブジェクトの [client secret](https://docs.stripe.com/api/payment_intents/object.md#payment_intent_object-client_secret)。 | > 顧客のブラウザーセッションを追跡するツールを利用している場合、リファラー除外リストに `stripe.com` ドメインの追加が必要になる場合があります。リダイレクトを行うと、一部のツールでは新しいセッションが作成され、セッション全体の追跡ができなくなります。 クエリパラメーターのいずれか 1 つを使用して PaymentIntent を取得します。[PaymentIntent のステータス](https://docs.stripe.com/payments/paymentintents/lifecycle.md)を調べて、顧客に表示する内容を決定します。また、`return_url` を指定するときにカスタムのクエリパラメーターを追加することもできます。このパラメーターはリダイレクトプロセスの間維持されます。 #### HTML + JS ```javascript // Initialize Stripe.js using your publishable key const stripe = Stripe('<>'); // Retrieve the "payment_intent_client_secret" query parameter appended to // your return_url by Stripe.js const clientSecret = new URLSearchParams(window.location.search).get( 'payment_intent_client_secret' ); // Retrieve the PaymentIntent stripe.retrievePaymentIntent(clientSecret).then(({paymentIntent}) => { const message = document.querySelector('#message') // Inspect the PaymentIntent `status` to indicate the status of the payment // to your customer. // // Some payment methods will [immediately succeed or fail][0] upon // confirmation, while others will first enter a `processing` state. // // [0]: https://stripe.com/docs/payments/payment-methods#payment-notification switch (paymentIntent.status) { case 'succeeded': message.innerText = 'Success! Payment received.'; break; case 'processing': message.innerText = "Payment processing. We'll update you when payment is received."; break; case 'requires_payment_method': message.innerText = 'Payment failed. Please try another payment method.'; // Redirect your user back to your payment page to attempt collecting // payment again break; default: message.innerText = 'Something went wrong.'; break; } }); ``` #### React ```jsx import React, {useState, useEffect} from 'react'; import {useStripe} from '@stripe/react-stripe-js'; const PaymentStatus = () => { const stripe = useStripe(); const [message, setMessage] = useState(null); useEffect(() => { if (!stripe) { return; } // Retrieve the "payment_intent_client_secret" query parameter appended to // your return_url by Stripe.js const clientSecret = new URLSearchParams(window.location.search).get( 'payment_intent_client_secret' ); // Retrieve the PaymentIntent stripe .retrievePaymentIntent(clientSecret) .then(({paymentIntent}) => { // Inspect the PaymentIntent `status` to indicate the status of the payment // to your customer. // // Some payment methods will [immediately succeed or fail][0] upon // confirmation, while others will first enter a `processing` state. // // [0]: https://stripe.com/docs/payments/payment-methods#payment-notification switch (paymentIntent.status) { case 'succeeded': setMessage('Success! Payment received.'); break; case 'processing': setMessage("Payment processing. We'll update you when payment is received."); break; case 'requires_payment_method': // Redirect your user back to your payment page to attempt collecting // payment again setMessage('Payment failed. Please try another payment method.'); break; default: setMessage('Something went wrong.'); break; } }); }, [stripe]); return message; }; export default PaymentStatus; ``` ### ウォレット情報の収集 Apple Pay または Google Pay を受け付ける場合は、送信ハンドラーの先頭で [elements.submit()](https://docs.stripe.com/js/elements/submit) を呼び出します。これにより、フォームの検証がトリガーされ、ネイティブの支払いシートが表示されるため、顧客は支払いのオーソリを行うことができます。 #### HTML + JS ```javascript form.addEventListener('submit', async (event) => { event.preventDefault(); // Trigger form validation and wallet collection const {error: submitError} = await elements.submit(); if (submitError) { handleError(submitError); return; } // Confirm the payment }); ``` #### React ```jsx const handleSubmit = async (event) => { event.preventDefault(); if (!stripe || !elements) { // Stripe.js hasn't yet loaded. // Make sure to disable form submission until Stripe.js has loaded. return; } // Trigger form validation and wallet collection const {error: submitError} = await elements.submit(); if (submitError) { handleError(submitError); return; } // Confirm the payment }; ``` ## Optional: 決済手順メールを送信する [ダッシュボード](https://dashboard.stripe.com/settings/emails)から銀行振込決済の手順メールを有効にできます。決済手順メールが有効になると、Stripe は以下の場合に顧客にメールを送信します。 - PaymentIntent が確定されましたが、顧客の残高が不足しています。 - 顧客が銀行振込を行いましたが、残高が不足しているため保留中の支払いを完了できませんでした。 銀行振込決済の手順メールには、請求金額、振込先の銀行情報、Stripe がオンラインで提供する手順ページへのリンクが記載されています。 > サンドボックスでは、決済手順メールは Stripe アカウントに関連付けられているメールアドレスにのみ送信されます。 ## PaymentIntent の成功を確認する PaymentIntent は、売上が銀行口座に入金されるまで `requires_action` ステータスのままとなります。売上の準備ができると、PaymentIntent のステータスが `requires_action` から `succeeded` に更新されます。 *ウェブフック* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests)エンドポイントは、`payment_intent.partially_funded` イベントを受信できるように設定する必要があります。Stripe は、PaymentIntent に資金が適用されたものの、決済が未完了のままである場合にこのイベントを送信します。最初に PaymentIntent を確認して `requires_action` に移行したときは、既存の顧客残高の資金が同時に適用されていた場合でも、Stripe は代わりに `payment_intent.requires_action` を送信します。 [ダッシュボードから Webhook を追加](https://dashboard.stripe.com/webhooks/create)できます。 また、[Webhook Endpoints API](https://docs.stripe.com/api/webhook_endpoints.md) を使用して [payment_intent.partially_funded](https://docs.stripe.com/api/events/types.md#event_types-payment_intent.partially_funded) イベントの受信を開始することもできます。 > [Stripe CLI](https://docs.stripe.com/stripe-cli.md) は、`payment_intent.partially_funded` など、ベータ API バージョンのイベントのトリガーはサポートしていません。 PaymentIntent が更新されると、以下のイベントが支払い資金追加フロー中に送信されます。 | イベント | 説明 | 次のステップ | | --------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `payment_intent.requires_action` | 顧客の残高に PaymentIntent を消し込むのに十分な資金がない場合、確定時に送信され、PaymentIntent は `requires_action` に移行します。 | `amount_remaining` を使用して銀行振込を行うよう顧客に指示します。 | | `payment_intent.partially_funded` | 顧客が送った銀行振込は PaymentIntent に適用されましたが、決済を完了するには十分ではありませんでした。これは、顧客の支払額が不足していた場合、銀行手数料によって受取額が減った場合、または残りの顧客残高が PaymentIntent に適用された場合に発生することがあります。一部のみ入金された PaymentIntent は、決済が完了するまでアカウント残高に反映されません。 | 新しい `amount_remaining` を使用して別の銀行振込を行い、支払いを完了するよう顧客に指示します。部分的に資金を充当して支払いを完了する場合は、`amount` を更新して PaymentIntent をもう一度[確定](https://docs.stripe.com/api/payment_intents/confirm.md)できます。 | | `payment_intent.succeeded` | 顧客の支払いが成功しました。 | 顧客が購入した商品またはサービスのフルフィルメントを行います。 | > 部分的に資金が充当された PaymentIntent の金額を変更すると、売上は顧客の残高に戻されます。他に open 状態の PaymentIntent がある場合、Stripe はそれらに自動で資金追加します。顧客に手動消し込みが設定されている場合は、もう一度[売上を充当する](https://docs.stripe.com/api/payment_intents/apply_customer_balance.md)必要があります。 支払いが成功したことを確認し、顧客に支払い完了を通知するには、[Webhook を使用](https://docs.stripe.com/payments/payment-intents/verifying-status.md#webhooks)することをお勧めします。 ### サンプルコード #### Ruby ```ruby require 'json' # Using Sinatra post '/webhook' do payload = request.body.read event = nil begin event = Stripe::Event.construct_from( JSON.parse(payload, symbolize_names: true) ) rescue JSON::ParserError => e # Invalid payload status 400 return end # Handle the event case event.type when 'payment_intent.requires_action' payment_intent = event.data.object # contains a Stripe::PaymentIntent # The payment intent was not fully funded due to insufficient funds # on the customer balance. Define and call a method to handle the payment intent. # handle_payment_intent_requires_action(payment_intent) when 'payment_intent.partially_funded' payment_intent = event.data.object # contains a Stripe::PaymentIntent # Then define and call a method to handle the payment intent being partially funded. # handle_payment_intent_partially_funded(payment_intent) when 'payment_intent.succeeded' payment_intent = event.data.object # contains a Stripe::PaymentIntent # Then define and call a method to handle the successful payment intent. # handle_payment_intent_succeeded(payment_intent) else puts "Unhandled event type: #{event.type}" end status 200 end ``` ### ダッシュボードで保留中の支払いを確認する [ダッシュボード](https://dashboard.stripe.com/payments)で**ステータス**に**資金供給待ち**のフィルターを適用すると、保留中のすべての銀行振込 PaymentIntent を確認できます。 ## 組み込みをテストする API、ダッシュボード、または Stripe CLI のベータバージョンを使用して、銀行振込の受け取りをシミュレーションすることにより、実装をテストできます。 > #### Accounts v2 の考慮事項 > > Accounts v2 API は、Connect ユーザーには一般提供されていますが、他の Stripe ユーザーには公開プレビューとして提供されています。[Accounts v2 プレビュー](https://docs.stripe.com/accounts-v2/use-accounts-as-customers.md)に参加している場合は、コード内で[プレビューバージョンを指定](https://docs.stripe.com/api-v2-overview.md#sdk-and-api-versioning)する必要があります。 > > 顧客設定済みの [Account](https://docs.stripe.com/api/v2/core/accounts/object.md#v2_account_object-configuration-customer) への受取銀行振込をシミュレーションするには、`Customer` ID の代わりに `Account` ID をパスパラメータとして使用し、 Test Helpers エンドポイントを使用します。例: `v1/test_helpers/customers/acct_xxxxx/fund_cash_balance` #### ダッシュボード ダッシュボードを使用して*サンドボックス* (A sandbox is an isolated test environment that allows you to test Stripe functionality in your account without affecting your live integration. Use sandboxes to safely experiment with new features and changes)で銀行振込をシミュレーションするには、ダッシュボードで顧客のページに移動します。**決済手段**で、**追加**をクリックして、**現金残高に資金を追加 (テスト環境のみ)** を選択します。 #### API API を使用して銀行振込をシミュレーションするには、以下のようにします。 #### US ```bash curl https://api.stripe.com/v1/test_helpers/customers/{{CUSTOMER_ID}}/fund_cash_balance \ -X POST \ -u <>: \ -d "reference"="REF-4242" \ -d "amount"="1000" \ -d "currency"="usd" ``` #### UK ```bash curl https://api.stripe.com/v1/test_helpers/customers/{{CUSTOMER_ID}}/fund_cash_balance \ -X POST \ -u <>: \ -d "reference"="REF-4242" \ -d "amount"="1000" \ -d "currency"="gbp" ``` #### EU ```bash curl https://api.stripe.com/v1/test_helpers/customers/{{CUSTOMER_ID}}/fund_cash_balance \ -X POST \ -u <>: \ -d "reference"="REF-4242" \ -d "amount"="1000" \ -d "currency"="eur" ``` #### JP ```bash curl https://api.stripe.com/v1/test_helpers/customers/{{CUSTOMER_ID}}/fund_cash_balance \ -X POST \ -u <>: \ -d "amount"="1000" \ -d "currency"="jpy" ``` #### MX ```bash curl https://api.stripe.com/v1/test_helpers/customers/{{CUSTOMER_ID}}/fund_cash_balance \ -X POST \ -u <>: \ -d "reference"="123456" \ -d "amount"="1000" \ -d "currency"="mxn" ``` #### Stripe CLI Stripe CLI で銀行振込をシミュレーションするには、以下のようにします。 1. [Stripe CLI をインストール](https://docs.stripe.com/stripe-cli.md)します。 2. Stripe ダッシュボードへのサインインに使用したアカウントで、CLI にログインします。 ```bash stripe login ``` 3. 既存の顧客への銀行振込をシミュレーションします。 #### US ```bash stripe test_helpers customers fund_cash_balance "{{CUSTOMER_ID}}" \ --amount=1099 \ --reference=DVGBG97TZ6ZV \ --currency=usd ``` `reference` パラメーターはオプションであり、顧客が銀行振込の参照フィールドに入力した値をシミュレーションします。 #### UK ```bash stripe test_helpers customers fund_cash_balance "{{CUSTOMER_ID}}" \ --amount=1099 \ --reference=DVGBG97TZ6ZV \ --currency=gbp ``` `reference` パラメーターはオプションであり、顧客が銀行振込の参照フィールドに入力した値をシミュレーションします。 #### EU ```bash stripe test_helpers customers fund_cash_balance "{{CUSTOMER_ID}}" \ --amount=1099 \ --reference=DVGBG97TZ6ZV \ --currency=eur ``` `reference` パラメーターはオプションであり、顧客が銀行振込の参照フィールドに入力した値をシミュレーションします。 #### JP ```bash stripe test_helpers customers fund_cash_balance "{{CUSTOMER_ID}}" \ --amount=1000 \ --currency=jpy ``` #### MX ```bash stripe test_helpers customers fund_cash_balance "{{CUSTOMER_ID}}" \ --amount=1099 \ --reference=123456 \ --currency=mxn ``` `reference` パラメーターはオプションであり、顧客が銀行振込の参照フィールドに入力した値をシミュレーションします。 ## 一時的に利用できない問題に対応する 次のエラーコードは、その支払い方法が一時的に使用できない状態にあることを示しています。 | コード | 説明 | 処理 | | ------------------------------------ | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | | `payment_method_rate_limit_exceeded` | この決済手段には、[API 全体のレート制限](https://docs.stripe.com/rate-limits.md)よりも厳しい制限が課されていますが、大量のリクエストが立て続けに実行されました。 | このエラーは、Web サイトでのセール期間中などに、多くの顧客が同じ決済方法を使用しようとすると、複数の API リクエストで生じることがあります。その場合は、顧客に別の決済方法を使用するように依頼します。 | > 全般的に、または今後のイベントで使用量が高くなることが想定される場合は、すぐに Stripe にお問い合わせください。