アプリのインストール非公開プレビュー
アプリのインストールボタンを表示します。
アプリインストールは、連結アカウントがアプリをインストールできるようにするコンポーネントをレンダリングします。アプリインストールはプライベートプレビュー版コンポーネントであり、Stripe SDK のプレビューバージョンを使用する必要があります。プライベートプレビュー版コンポーネントの詳細をご覧ください。
実装の詳細については、埋め込み Stripe アプリ実装ガイドを参照してください。
アカウントセッションを作成する
アカウントセッションの作成時に、components
パラメーターで app_install
を指定して、アプリのインストールコンポーネントを有効にします。allowed_apps
で features
パラメーターを指定することにより、インストールするアプリを有効にしてください。
curl https://api.stripe.com/v1/account_sessions \
-u "sk_test_BQokikJOvBiI2HlWgH4olfQ2
:" \
-H "Stripe-Version: 2025-02-24.acacia; embedded_connect_beta=v2;" \
-d account= \
-d "components[app_install][enabled]"=true \
-d "components[app_install][features][allowed_apps][]"=APP_ID
アカウントセッションを作成して、ConnectJS を初期化すると、フロントエンドにアプリのインストールコンポーネントを表示できます。
const appInstall = stripeConnectInstance.create('app-install');
appInstall.setApp('{{APP_ID}}');
container.appendChild(appInstall);
この埋め込みコンポーネントは、次のパラメーターに対応します。
方法 | タイプ | 説明 |
---|
setApp | string | Sets the ID of the App your connected account can install. See the list of available apps. |
You can configure custom behavior based on the current or updated state of an install.
<div id="app-install-container"></div>
const handleAppInstallFetched = (response) => {
console.log(`Install state fetched for app ${response.appId} to ${response.state}`);
};
const handleAppInstallChanged = (response) => {
console.log(`Install state changed for app ${response.appId} to ${response.state}`);
};
const container = document.getElementById('app-install-container');
const appInstall = stripeConnectInstance.create('app-install');
appInstall.setApp('{{APP_ID}}');
appInstall.setOnAppInstallStateFetched(handleAppInstallFetched);
appInstall.setOnAppInstallStateChanged(handleAppInstallChanged);
container.appendChild(appInstall);
方法 | 説明 | 変数 |
---|
setOnAppInstallStateFetched | Allows users to specify custom behavior in a callback function on install fetch. | response.appId : The app installedresponse.state : The state of the install INSTALLED | UNINSTALLED
|
setOnAppInstallStateChanged | Allows users to specify custom behavior in a callback function when the install state has changed. | response.appId : The app installedresponse.state : The state of the install INSTALLED | UNINSTALLED
|
プラットフォームに埋め込むことを事前に承認した Stripe のサンプルアプリ (APP_ID
を stripe.app-explorer
に設定) を導入できます。
早期アクセスをリクエストする プライベートプレビュー
サインインして、プレビュー版の Connect 埋込型コンポーネントへのアクセスをリクエストします。
Stripe アカウントがない場合は、今すぐ登録できます。