调至内容部分
创建账户或登录
Stripe 文档徽标
/
询问人工智能
创建账户登录
开始
付款
销售收入
平台和交易市场
资金管理
开发人员资源
API 和 SDK帮助
概览
开始使用 Connect
设计集成
集成基础知识
    为 Connect 子账户调用 API
    集成推荐
    迁移到受支持的配置
    配置 Connect 子账户的行为
    在现有集成中使用 Accounts v2 API
    以客户身份使用账户
    侦听更新
    测试
集成示例
账户管理
账户入驻
配置账户管理平台
能力与信息需求
使用 Connect 子账户类型
付款处理中
接受付款
给账户打款
平台管理
管理您的 Connect 平台
Connect 平台的税表
美国
简体中文
首页平台和交易市场Integration fundamentals

Testing Stripe Connect

Before going live, test your Connect integration for account creation, identity verification, and payouts.

Use testing to make sure your Connect integration handles different flows correctly. You can use Sandboxes to simulate live mode while taking advantage of Stripe-provided special tokens to use in your tests. See the payments testing guide for more information on testing charges, disputes, and so on.

Testing capabilities

Sandboxes and test mode might not enforce some capabilities. In certain cases, they can allow an account to perform capability-dependent actions even when the associated capability’s status isn’t active.

Create test accounts

You can create multiple test accounts with different account types or controller properties that you want to test.

You can create test accounts using the Accounts API or in the Stripe Dashboard.

Use 000-000 as the SMS code when prompted for test accounts.

Test the OAuth flow

You can test your OAuth integration with connected accounts that use a Stripe-hosted Dashboard using your test client_id.

Your test client_id is ca_FkyHCg7X8mlvCUdMDao4mMxagUfhIwXb. You can find this in your Connect OAuth settings.

Your test client_id allows you to:

  • Set your redirect_uri to a non-HTTPS URL
  • Set your redirect_uri to localhost
  • Force-skip the account form instead of having to fill out an entire account application (Stripe Dashboard accounts only)
  • Get test access tokens for connected accounts

To test the OAuth flow, create a new account after clicking the OAuth link. You can also test connecting an existing Stripe account only if the email is different from your platform account.

Identity verification

Testing verification guide

Verification is a crucial component for onboarding accounts. Use our dedicated guide to testing verification.

After creating a test connected account, you can use tokens to test different verification statuses to make sure you’re handling different requirements and account states. You can use the following tokens to test verification with test accounts.

Test dates of birth

Use these dates of birth (DOB) to trigger certain verification conditions.

出生日期类型
1901-01-01Successful date of birth match. Any other DOB results in a no-match.
1902-01-01Successful, immediate date of birth match. The verification result is returned directly in the response, not as part of a webhook event.
1900-01-01This DOB triggers an Office of Foreign Assets Control (OFAC) alert.

Test addresses

Use these addresses for line1 to trigger certain verification conditions. You must pass in legitimate values for the city, state, and postal_code arguments.

令牌类型
address_full_match​Successful address match.
address_no_matchUnsuccessful address match likely to trigger requirements in currently_due.
address_line1_no_matchUnsuccessful address match likely to trigger requirements in currently_due

Test personal ID numbers

Use these personal ID numbers for the individual.id_number attribute on the Account or the id_number attribute on the Person object to trigger certain verification conditions.

尾号类型
000000000Successful ID number match. 0000 also works for SSN last 4 verification.
111111111Unsuccessful ID number match (identity mismatch) likely to trigger requirements in currently_due.
222222222Successful, immediate ID number match. The verification result is returned directly in the response, not as part of a webhook event.

Test government-issued ID documents

For testing, use test images or file tokens instead of uploading your own test IDs. For details, refer to Uploading a file.

Test document images

You can use a verified image that causes the ID number to match successfully. You can use an unverified image that causes a mismatch on the ID number, leading to currently_due requirements.

注意

Test images take precedence over test ID numbers. If you upload a verified image, the ID number matching succeeds, even if you also provide an unsuccessful test ID value. Similarly, an unverified image automatically fails ID matching regardless of the value of other test artifacts.

Test file tokens

Use these file tokens to trigger certain identity verification conditions.

令牌类型
file_identity_document_successUses the verified image and marks that document requirement as satisfied.
file_identity_document_failureUses the unverified image and marks that document requirement as not satisfied.

Business information verification

Business address validation

In some countries, the business address associated with your connected account must be validated before charges, payouts, or both can be enabled on the connected account.

Test business addresses

Use these addresses for line1 to trigger certain validation conditions. You must pass in legitimate values for the city, state, and postal_code arguments.

Make sure you start with an address token that has the least permissive validation condition you want to test for. This is because you can’t use an address token that has a more restrictive validation condition than the previous token used. For example, if you provided address_full_match to have both charges and payouts enabled, you can’t disable payouts or charges afterward by changing the token to an invalid one. You can work around this by creating a new account with the relevant token.

令牌类型
address_full_match​Both charges and payouts are enabled on the account.
address_no_match​Only charges are enabled on the account. Since validation failed on the line1 attribute, it becomes listed again in the requirements hash.
address_line1_no_matchNeither charges nor payouts are enabled on the account. Since validation failed, the address attributes become listed again in the requirements hash.

Test business tax IDs

Use these business tax ID numbers for company.tax_id to trigger certain verification conditions. The test behavior might change depending on the Connected Account countries and the regulations in those countries. Depending on the country’s regulation, a valid tax document can mark tax ID verified in these countries.

尾号类型
000000000Successful business ID number match.
000000001Successful business ID number match as a non-profit.
111111111Unsuccessful business ID number match (identity mismatch).
111111112Unsuccessful business ID number match (tax ID not issued).
222222222Successful, immediate business ID number match. The verification result is returned directly in the response, not as part of a webhook event.

Test directorship verification

Stripe performs directorship verification by comparing the list of directors on the Account object against a list retrieved from local registries. If the country requires it, you can trigger verification for an Account object by using these tokens for the first_name attribute on the associated Person and setting the relationship.director attribute on the Person to true.

令牌类型
mismatch_directorUnsuccessful match due to a mismatched name. This can trigger a verification_directors_mismatch verification error.
missing_directorUnsuccessful match due to directors missing on the account. This can trigger a verification_missing_directors verification error.
extraneous_directorUnsuccessful match due to too many directors on the account. This can trigger a verification_extraneous_directors verification error.

The verification errors can trigger if multiple directors on the Account object use these magic tokens.

Test company name verification

Trigger company name verification for an Account object by using this token for the company.name attribute.

令牌类型
mismatch_business_nameUnsuccessful match due to a mismatched business name.
disallowed_nameUnsuccessful match due to a generic or well-known business name.
match_name_relationshipsSuccessful match of the business name.
match_name_onlyUnsuccessful match due to a business name discrepancy.

Test statement descriptor verification

Trigger statement descriptor verification for an Account object by using this token for the settings.payments.statement_descriptor attribute.

令牌类型
mismatchTrigger an invalid_statement_descriptor_business_mismatch verification error.
disallowedTrigger an invalid_statement_descriptor_denylisted verification error.

Trigger statement descriptor prefix verification for an Account object by using this token for the settings.card_payments.statement_descriptor_prefix attribute.

令牌类型
mismatchTrigger an invalid_statement_descriptor_prefix_mismatch verification error.
disallowedTrigger an invalid_statement_descriptor_prefix_denylisted verification error.

Test business URL verification

Trigger URL verification for an Account object by using this token for the business_profile.url attribute.

令牌类型
https://disallowed.stripe.comTrigger an invalid_url_denylisted verification error.
https://geoblocked.stripe.comTrigger an invalid_url_website_inaccessible_geoblocked verification error.
https://problem.stripe.comTrigger an invalid_url_website_other verification error.
https://missing.stripe.comTrigger an invalid_url_website_incomplete verification error.
https://mismatch.stripe.comTrigger an invalid_url_website_business_information_mismatch verification error.
https://passwordprotected.stripe.comTrigger an invalid_url_website_inaccessible_password_protected verification error.
https://accessible.stripe.comTrigger a successful validation of the URL.
https://underconstruction.stripe.comTrigger an invalid_url_website_incomplete_under_construction verification error.
https://inaccessible.stripe.comTrigger an invalid_url_website_inaccessible verification error.

Test capability disabled reasons

Trigger assignment of a specific requirements.disabled_reason to all of an Account object’s inactive Capability objects by using this token for the account’s business_profile.url attribute.

令牌类型
https://inactivity.stripe.comSet an account as inactive and pause all verifications for it. Set the disabled reason for any inactive capabilities to paused.inactivity (rejected.other for API versions prior to 2024-06-20).

Test Doing Business As (DBA) verification

Trigger DBA verification for an Account object by using this token for the business_profile.name attribute.

令牌类型
disallowed_dbaTrigger an invalid_business_profile_name_denylisted verification error.
invalid_dbaTrigger an invalid_business_profile_name verification error.

Test product description verification

Trigger product description verification for an Account object by using this token for the business_profile.product_description attribute.

令牌类型
require_urlTrigger an invalid_url_web_presence_detected verification error.

Test phone number validation

Clear phone number validation for an Account object by using this token for the following attributes:

  • business_profile.support_phone
  • company.phone
  • individual.phone

Clear phone number validation for a Person object by using this token for the phone attribute.

令牌类型
0000000000Successful validation

Trigger or advance verification

Trigger cards

Use these card numbers to trigger various conditions when you’re testing both requirements and tiered verification. For the trigger actions to work, you must use these cards with a Connect charge by setting on_behalf_of or creating a direct charge on the connected account. The connected account must have an eventually_due requirement.

尾号令牌类型
4000000000004202tok_visa_triggerNextRequirementsChanges the next set of eventually due requirements to currently due.
4000000000004210tok_visa_triggerChargeBlockTriggers a charge block.
4000000000004236tok_visa_triggerPayoutBlockTriggers a payout block.

Trigger next requirements

Live mode can require additional verification information when a connected account processes a certain amount of volume. This card sets any additional verification information to be required immediately. If no additional information is required, nothing appears.

Trigger a charge or payout block

If required information isn’t provided by the deadline, Stripe disables the connected account’s charges or payouts. These cards disable the connected account and move any currently due requirements to overdue. These cards have no effect until an account provides the initial information that’s required to enable charges and payouts.

Trigger bank account ownership verification

Connected accounts in the United States and India are subject to Bank account ownership verification. You can complete this verification by uploading supporting documents with the Connect Dashboard or with the API through the documents[bank_account_ownership_verification] hash.

While you’re testing, you can simulate the US bank account ownership verification process. Use the following test bank account numbers to trigger the verification process. One number presumes successful verification and the other prompts you to upload test images or file tokens to complete the verification process. These test accounts are only available for US accounts.

路径账户类型
110000000000999999991Triggers and completes the bank account ownership verification process after a short delay
110000000000999999992Triggers the bank account ownership verification process after a short delay and requests for document upload

Add funds to Stripe balance

To test adding funds to your Stripe balance from a bank account in the Dashboard, create a sandbox and select the desired test bank account in the dropdown menu within the Add to balance dialog. You can simulate success or failure due to insufficient funds.

To test adding funds in the API, use the following test bank tokens as the source while you’re testing. Each token simulates a specific kind of event.

令牌类型
btok_us_verified成功
btok_us_verified_noAccountUnsuccessful with a no_account code
btok_us_verified_accountClosedUnsuccessful with an account_closed code
btok_us_verified_insufficientFundsUnsuccessful with an insufficient_funds code
btok_us_verified_debitNotAuthorizedUnsuccessful with a debit_not_authorized code
btok_us_verified_invalidCurrencyUnsuccessful with an invalid_currency code

Payouts

在测试提现功能时,请使用以下测试银行账号和借记卡卡号来触发特定事件。这些数值仅可在采用测试 API 密钥进行测试时使用。

测试提现会模拟真实提现流程,但不会通过银行进行处理。只要满足有效的外部银行信息及其他相关条件,拥有 Stripe 管理平台访问权限的测试账户始终会启用提现功能,且永远无需进行真实的身份验证。

注意

在已接入真实模式的 Connect 子账户中,您不能在 Stripe 管理平台里使用测试银行账号和测试借记卡卡号。如果您已在真实模式账户中输入了银行账户信息,您仍可以使用沙盒环境,且测试提现将模拟真实提现流程,但不会处理实际资金。

银行账号

使用这些测试银行账号来测试提现。这些账号仅可与测试 API 密钥一同使用。

路径账户Type
110000000000123456789提现成功。
110000000000111111116提现失败,错误代码为 no_account。
110000000000111111113提现失败,错误代码为 account_closed。
110000000000222222227提现失败,错误代码为 insufficient_funds。
110000000000333333335提现失败,错误代码为 debit_not_authorized。
110000000000444444440提现失败,错误代码为 invalid_currency。
110000000000888888883如果 method 是 instant,则提现失败。银行账户不符合 Instant Payout 的条件。

借记卡卡号

请使用这些测试借记卡卡号来测试向借记卡提现。您仅能与测试 API 密钥一同使用这些卡号。

尾号令牌类型
4000056655665556tok_visa_debit_us_transferSuccessVisa 借记卡。提现成功。
4000056655665572tok_visa_debit_us_transferFailVisa 借记卡。提现失败,并显示 could_not_process 代码。
4000056755665555tok_visa_debit_us_instantPayoutUnsupportedVisa 借记卡。银行卡不符合即时提现的条件。
5200828282828210tok_mastercard_debit_us_transferSuccess万事达卡借记卡。提现成功。
6011981111111113tok_discover_debit_us_transferSuccessDiscover 借记卡。提现成功。
此页面的内容有帮助吗?
是否
  • 需要帮助?联系支持。
  • 查看我们的更改日志。
  • 有问题?联系销售。
  • LLM? Read llms.txt.
  • Powered by Markdoc