Stripe のホスティング登録
Stripe のホスティング登録フローにリダイレクトして連結アカウントを登録します。
Stripe のホスティング登録が連結アカウントからの事業情報と本人確認情報の収集を処理するため、プラットフォームが担当する作業は最小限で済みます。これは Stripe がオンラインで提供するウェブフォームであり、各連結アカウントのケイパビリティ、国、業種に基づいて動的にレンダリングされます。

Stripe の導入サンプルである Rocket Deliveries のホスティング登録フォームは以下のようになります。
Stripe-hosted onboarding with Accounts v1 supports networked onboarding, which allows owners of multiple Stripe accounts to share business information between them. When they onboard an account, they can reuse that information from an existing account instead of resubmitting it.
アカウント登録フォームをカスタマイズするダッシュボード
ダッシュボードの Connect の設定ページに移動して、ブランド名、色、アイコンでフォームの視覚的なデザインをカスタマイズします。Stripe のホスティング登録にはこの情報が必要です。Stripe では、連結アカウントのアカウント登録を行う際に、その銀行口座情報を収集することもお勧めしています。
アカウントを作成し、情報を事前入力するサーバー側
デフォルトの controller (コントローラー) プロパティを使用して連結アカウントを作成します。コントローラープロパティについて、詳細はシステムの設計をご覧ください。または、アカウントの type (タイプ) を指定して、連結アカウントを作成することもできます。
If you specify the account’s country or request any capabilities for it, then the account owner can’t change its country. Otherwise, it depends on the account’s Dashboard access:
- Full Stripe Dashboard: During onboarding, the account owner can select any acquiring country, the same as when signing up for a normal Stripe account. Stripe automatically requests a set of capabilities for the account based on the selected country.
- Express Dashboard: During onboarding, the account owner can select from a list of countries that you configure in your platform Dashboard Onboarding options. You can also configure those options to specify the default capabilities to request for accounts in each country.
- No Stripe Dashboard: If Stripe is responsible for collecting requirements, then the onboarding flow lets the account owner select any acquiring country. Otherwise, your custom onboarding flow must set the country and request capabilities.
レスポンスには ID が含まれており、システム全体で Account
を参照する場合はこれを使用します。
ケイパビリティをリクエストする
You can request capabilities when creating an account by setting the desired capabilities’ requested
property to true. For accounts with access to the Express Dashboard, you can also configure your Onboarding options to automatically request certain capabilities when creating an account.
Stripe’s onboarding UIs automatically collect the requirements for requested capabilities. To reduce onboarding effort, request only the capabilities you need.
Prefill information
If you have information about the account holder (like their name, address, or other details), you can simplify onboarding by providing it when you create or update the account. The onboarding interface asks the account holder to confirm the pre-filled information before accepting the Connect service agreement.
If you onboard an account and your platform provides it with a URL, prefill the account’s business_profile.url. If the business doesn’t have a URL, you can prefill its business_profile.product_description instead.
実装内容をテストする際は、テストデータを使用して、本人確認、事業情報の確認、入金の失敗などのさまざまな結果をシミュレーションできます。
収集する情報を決定する
As the platform, you must decide if you want to collect the required information from your connected accounts up front or incrementally. Up-front onboarding collects the eventually_
requirements for the account, while incremental onboarding only collects the currently_
requirements.
Onboarding type | メリット |
---|---|
Up-front |
|
Incremental |
|
To determine whether to use up-front or incremental onboarding, review the requirements for your connected accounts’ locations and capabilities. While Stripe tries to minimize any impact to connected accounts, requirements might change over time.
For connected accounts where you’re responsible for requirement collection, you can customize the behavior of future requirements using the collection_
parameter. To collect the account’s future requirements, set collection_
to include
.
アカウントリンクを作成するサーバー側
連結アカウントの ID を使用して Account Link (アカウントリンク) を作成し、再読み込み URL と戻り先 URL を含めます。アカウントリンクの URL がすでに使用されているか、期限切れであるか、または無効である場合、Stripe は連結アカウントを再読み込み URL にリダイレクトします。Stripe は、連結アカウントがアカウント登録フローを完了または中断すると、戻り先 URL にリダイレクトします。さらに、収集する必要のある情報に基づいて、collection_
に currently_
または eventually_
のいずれかを渡します。この例では、アップフロントアカウント登録を使用するために eventually_
を渡します。インクリメンタルアカウント登録を使用するには、currently_
を設定します。
連結アカウントをアカウントリンク URL にリダイレクトする
Redirect the connected account to the Account Link URL to send them to the onboarding flow. Each Account Link URL can only be used once, because it grants access to the account holder’s personal information. Authenticate the account in your application before redirecting them to this URL.
Identify and address requirement updatesサーバー側
Set up your integration to listen for changes to account requirements. You can test handling new requirements (and how they might disable charges and payouts) with the test trigger cards.
Send a connected account back through onboarding when it has any currently_
or eventually_
requirements. You don’t need to identify the specific requirements, because the onboarding interface knows what information it needs to collect. For example, if a typo is preventing verification of the account owner’s identity, onboarding prompts them to upload an identity document.
Stripe notifies you about any upcoming requirements updates that affect your connected accounts. You can proactively collect this information by reviewing the future requirements for your accounts.
For connected accounts where controller.requirement_collection is stripe
, stop receiving updates for identity information after creating an Account Link or Account Session.
Accounts store identity information in the company
and individual
hashes.
確認エラーを処理する
account.updated イベントをリッスンします。current_
が着信したときにアカウントに currently_
フィールドが含まれている場合は、対応する機能が無効になり、そのフィールドが past_
に追加されます。
Stripe ホスティング登録フォームにアカウントを誘導して、確認要件を修正できるようにします。
プラットフォームに戻る連結アカウントを処理するサーバー側
連結アカウントがプラットフォームにリダイレクトされるすべてのケースに対応するために、アカウントリンクには refresh_
と return_
が必要です。連結アカウントに最適なアカウント登録フローを提供するには、これらを正しく実装することが重要です。
注
テスト環境 (ローカルでテストする場合など) では、refresh_
と return_
に HTTP を使用できますが、本番環境で使用できるのは HTTPS のみです。本番環境に移行する前に、テスト用の URL を HTTPS URL に入れ替えたことを必ず確認してください。
再読み込み URL
以下の場合、連結アカウントは refresh_
にリダイレクトされます。
- リンクの期限が切れている (リンク作成後、数分が経過した)。
- リンクがすでに使用された (連結アカウントがページを更新したか、ブラウザーで戻るまたは進むボタンをクリックした)。
- リンクが、URL にアクセスしてプレビューを試みる、メッセージングクライアントなどのサードパーティーアプリケーションに共有された。または、多くのクライアントが自動的にリンクにアクセスすることにより、期限切れになった場合。
refresh_
は、サーバーでメソッドを呼び出して、同じパラメーターを使用して新しい Account Link (アカウントリンク) を作成し、また連結アカウントを新しいアカウントリンクの URL にリダイレクトします。
戻り先 URL
ユーザーがアカウント登録フローを完了するか、フローの任意の時点で後で処理するために保存をクリックすると、Stripe はもう一度この URL に連結アカウントをリダイレクトします。これは、すべての情報が収集されたことを意味するものでも、アカウントの要件がすべて満たされたことを意味するものでもありません。ユーザーがフローに正常に入り、そこから正常に出たことのみを意味します。
No state is passed with this URL. After a connected account is redirected to the return_
, determine if the account has completed onboarding. Retrieve the account and check the requirements hash for outstanding requirements. Alternatively, listen to the account.
event sent to your webhook endpoint and cache the state of the account in your application. If the account hasn’t completed onboarding, provide prompts in your application to allow them to continue onboarding later.
連結アカウントによって開始された更新を処理するサーバー側
Stripe がオンラインで提供するオンボーディングでは、連結アカウントによって開始される、すでに提供された情報の更新もサポートされます。Webhook エンドポイントに送信された account.
イベントをリッスンして、アカウントが ID チェックを完了し情報を更新したときに通知されるようにします。
アカウントリンクを作成する際、type
を account_
または account_
のいずれかに設定できます。
Account Links for account_onboarding 
このタイプのアカウントリンクは、未対応の要件を入力するためのフォームを提供します。新しい連結アカウントを登録する場合、または既存のユーザーに新しい要件がある場合 (たとえば、連結アカウントからすでに十分な情報が提供されていたが、お客様が追加情報を必要とする新しいケイパビリティをリクエストした場合など) に使用します。このタイプのアカウントリンクにユーザーを送ると、必要な新しい情報のみが収集されます。
Account Links for account_update 
このタイプのアカウントリンクは、プラットフォームが要件の収集について責任を負うアカウントに対して有効になります。account_
リンクには、アカウントオブジェクトにすでに入力されている属性が表示され、連結アカウントは以前に提供した情報を編集できます (住所を更新する必要がある場合など)。ご使用のアプリケーションで、連結アカウントが自身で更新するためのオプション (「プロフィールの編集」や「本人確認情報の更新」など) を用意します。
Browser support
Stripe-hosted onboarding is only supported in web browsers. You can’t use it in embedded web views inside mobile or desktop applications.