调至内容部分
创建账户
或
登录
Stripe 文档徽标
/
询问人工智能
创建账户
登录
开始
付款
销售收入
平台和交易市场
资金管理
开发人员资源
概览
开始使用 Connect
集成基础知识
集成示例
账户管理
账户入驻
配置账户管理平台
    开始使用 Connect 嵌入式组件
    自定义 Connect 嵌入式组件
    支持的 Connect 嵌入式组件
      入驻与合规
      账户管理
      账户入驻
      通知横幅
      支付管理
      付款
      付款详情
      付款争议
      争议列表
      支付方式设置
      提现管理
      提现
      提现列表
      提现详情
      余额
      即时提现推广
      Capital
      资本构成
      税务
      收税注册地
      税务设置
      导出税务交易
      起征点监控
      产品税务代码选择器
      Treasury 和 Issuing
      金融账户
      金融账户交易
      发卡
      发卡列表
      报告
      文档
      报告图表
      应用
      应用程序安装
      应用程序视口
    Stripe 管理平台定制
    Stripe 管理平台账户的平台控制
    Express 管理平台
使用 Connect 子账户类型
付款处理中
接受付款
给账户打款
平台管理
管理您的 Connect 平台
Connect 平台的税表
首页平台和交易市场Configure account DashboardsSupported Connect embedded components

Notification banner

Show a banner that lists required actions for risk interventions and onboarding requirements.

Renders a notification banner that lists open tasks that can affect a connected account’s status or capabilities. Tasks can involve risk interventions or outstanding requirements for account capabilities, such as accepting payments and payouts. The banner renders only when the connected account must respond to risk interventions or provide currently due requirements after initial onboarding.

Requirements collection options

You can control the collection of currently_due or eventually_due requirements and the inclusion of future requirements by using the collectionOptions attribute when you integrate the notification banner component.

External account collection

Use the external_account_collection feature to control whether the component collects external account information. This parameter is enabled by default, and only platforms responsible for collecting updated information when requirements are due or change (including Custom accounts) can disable it. When external_account_collection is enabled, user authentication is required. You can opt out of Stripe user authentication with the disable_stripe_user_authentication parameter.

Disable Stripe user authentication

Use the disable_stripe_user_authentication feature to control whether the component requires Stripe user authentication. The default value is the opposite of the external_account_collection value. For example, if you don’t set external_account_collection, it defaults to true and disable_stripe_user_authentication defaults to false. This value can only be true for accounts where controller.requirement_collection is application.

We recommend implementing 2FA or equivalent security measures as a best practice. For account configurations that support this feature, such as Custom accounts, you assume liability for connected accounts if they can’t pay back negative balances.

Create an Account Session

When creating an Account Session, enable notification banner by specifying notification_banner in the components parameter.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/account_sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d account=
{{CONNECTED_ACCOUNT_ID}}
\ -d "components[notification_banner][enabled]"=true \ -d "components[notification_banner][features][external_account_collection]"=true

Render the notification banner component

notification-banner.js
JavaScript
React
No results
// Include this element in your HTML const notificationBanner = stripeConnectInstance.create('notification-banner'); container.appendChild(notificationBanner); // Optional: // notificationBanner.setCollectionOptions({ // fields: 'eventually_due', // futureRequirements: 'include', // })
MethodTypeDescriptionDefault
setCollectionOptions{ fields: 'currently_due' | 'eventually_due', future_requirements: 'omit' | 'include' }Customizes collecting currently_due or eventually_due requirements and controls whether to include future requirements. Specifying eventually_due collects both eventually_due and currently_due requirements.{fields: 'currently_due', futureRequirements: 'omit'}

setOnNotificationsChange

({total: number, actionRequired: number}) => void

Allows users to specify an optional custom behavior in a callback function.

  • response.total: The total number of notifications in the banner
  • response.actionRequired: The number of notifications that require user action

Configure custom banner behavior

You can configure custom behavior, such as different margins, for when the banner includes any notifications or when the notifications require any action. To do so, set a custom callback function using onNotificationsChange.

notification-banner.js
JavaScript
React
No results
// index.html <h1 id="notification-banner-action-warning"></h1> <div id="notification-banner-container"></div> // index.js const handleNotificationsChange = (response) => { const warning = document.getElementById("notification-banner-action-warning"); if (response.actionRequired > 0) { // Do something related to required actions, such as adding margins to the banner container or tracking the current number of notifications. warning.style.display = "block"; warning.textContent = "You must resolve the notifications on this page before proceeding."; } else if (response.total > 0) { // Do something related to notifications that don't require action. warning.style.display = "block"; warning.textContent = "The items below are in review."; } else { warning.style.display = "none"; } }; const container = document.getElementById('notification-banner-container'); const notificationBanner = stripeConnectInstance.create('notification-banner'); notificationBanner.setOnNotificationsChange(handleNotificationsChange); container.appendChild(notificationBanner);

Testing

To test this component in a sandbox, specify different test inputs for fields that fail verifications or generate requirements on the account. For example, you can use the account management component to enter address_no_match in line1 of an individual’s address to trigger an address mismatch. In production, it can be difficult to verify that this component is working as expected because it’s hidden when an account has no banner items. To validate your integration is working, you can:

  • Set a callback using onNotificationsChange that verifies response.total is zero
  • Confirm the component is being displayed with no content using a loader start handler

Account onboarding

Use the notification banner after the account goes through account onboarding and has details_submitted. The banner won’t render any UI if the account is missing details_submitted.

此页面的内容有帮助吗?
是否
  • 需要帮助?联系支持。
  • 加入我们的早期使用计划。
  • 查看我们的更改日志。
  • 有问题?联系销售。
  • LLM? Read llms.txt.
  • Powered by Markdoc