インストールとディープリンク

インストールとディープリンク

インストールリンク

インストールリンクフォーマット

https://marketplace.stripe.com/oauth/v2/authorize?client_id=APP_ID&redirect_uri=REDIRECT_URI&state=STATE_VALUE

CSRF保護

import crypto from 'crypto';
const generateInstallLink = (req, res) => {
const state = crypto.randomBytes(32).toString('hex');
req.session.stripeInstallState = state;
const installUrl = new URL('https://marketplace.stripe.com/oauth/v2/authorize');
installUrl.searchParams.set('client_id', 'com.tajo.brevo-integration');
installUrl.searchParams.set('redirect_uri', 'https://tajo.io/stripe/callback');
installUrl.searchParams.set('state', state);
res.redirect(installUrl.toString());
};

ディープリンク

ディープリンクURLフォーマット

https://dashboard.stripe.com/MODE/acct_ID/PAGE?apps[APP_ID][TARGET]=VIEWPORT_ID

プログラムによるディープリンク生成

const generateDeepLink = ({
accountId, mode = 'live', page,
appId = 'com.tajo.brevo-integration',
target = 'drawer', viewport,
}) => {
const baseUrl = `https://dashboard.stripe.com/${mode}/${accountId}/${page}`;
const params = new URLSearchParams();
params.set(`apps[${appId}][${target}]`, viewport);
return `${baseUrl}?${params.toString()}`;
};

Tip

インストールリンクとディープリンクはliveモードとtestモードの両方でテストしてください。

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

AIアシスタント

こんにちは!ドキュメントについて何でもお聞きください。

Brevoで無料で始める