已设置无需银行信息,Stripe Express账户注册仍遭强制要求
问题:Express账户创建时无法跳过银行信息填写,即使已关闭强制要求
- 已在Stripe主账户的
https://dashboard.stripe.com/settings/connect/payouts/external_accounts页面,将“是否要求至少一个银行账户?”设置为「否——关联账户可添加银行账户,但非强制要求。关联账户仅在需要接收付款时才需添加外部账户」 - 但Express账户用户创建账户时仍无法跳过银行信息填写步骤
- 疑问:是API调用错误还是Stripe配置问题?
以下是Next.js服务端的API调用代码:
export async function GET(request: NextRequest) { try { // fetch the auth token from the trusted source (Cognito) const authSession = await fetchSessionFromServer() const idToken = authSession?.tokens?.idToken?.toString() const user = authSession?.tokens?.idToken?.payload as any // validate token/user if (!authSession || !idToken || !user) throw new Error("Missing token in authorization header") if (!user.email || !user['cognito:username']) throw new Error("Bad token, missing username and/or email") if (!user.address) throw new Error("Bad token, missing address") let address = user.address.formatted || user.address address = JSON.parse(address) const country = address.countryName if(!country) throw new Error("Failed to parse the country from the token") const countryCode = getValidCountryCode(country) if(!countryCode) throw new Error("Failed to parse the country code from the token") let account : any= {}; if (user.stripe_account_id?.startsWith('acct_')) { account['id'] = user.stripe_account_id } else { // then create Stripe Account for host account = await stripe.accounts.create( { country: countryCode, type: 'express', email: user.email, individual: { address: { line1: address.houseNumber + " " + address.street, line2: address.unit ? address.unit + " " : "", city: address.city, state: address.state, country: countryCode, postal_code: address.postalCode, }, dob: { day: user.birthdate.split('-')[2], month: user.birthdate.split('-')[1], year: user.birthdate.split('-')[0], }, email: user.email, first_name: user.name.split(NAME_SEPARATOR).at(0), last_name: user.name.split(NAME_SEPARATOR).at(-1), phone: user.phone_number, registered_address: { line1: address.houseNumber + " " + address.street, line2: address.unit ? address.unit + " " : "", city: address.city, state: address.state, country: countryCode, postal_code: address.postalCode, }, relationship: { owner: true, } }, company: { address: { line1: '123 Main Rd', line2: "Ste A", city: 'Newark', state: 'Delaware', country: 'US', postal_code: '19702', }, name: "My Cool App", }, capabilities: { // card_payments: { //not needed for destination charges I think // requested: true, // }, transfers: { requested: true, }, }, business_type: 'individual', business_profile: { mcc: '1234', name: `My Cool App - ${user['cognito:username']}`, product_description: 'Small private owner affiliated with My Cool App', url: 'https://my-cool-app.com', // url: 'https://my-cool-app.com/host-user-profile/[:id]', support_address: { line1: '123 Main Rd', line2: "Ste A", city: 'Newark ', state: 'Delaware', country: 'US', postal_code: '19702', }, support_email: 'admin@my-cool-app.com', support_url: 'https://my-cool-app.com', // TODO }, metadata: { my-cool-app_user_id: user['cognito:username'], email: user.email, }, tos_acceptance: {service_agreement: countryCode === 'US' ? 'full' : 'recipient'}, //https://www.youtube.com/watch?v=xN79dwF-rOE&list=PLy1nL-pvL2M6M-0U689W1LhniGl341gVA&index=13 at 8:25 settings: { payments: { statement_descriptor: "my-cool-app", }, payouts: { debit_negative_balances: countryCode === 'US', schedule: { delay_days: 7, interval: 'monthly', monthly_anchor: 31, }, statement_descriptor: "my-cool-app hosting", }, //branding: {}, //TODO }, }, { apiKey: stripeSecretKey, }, ); } // then create a Account Link with that account's ID const link = await stripe.accountLinks.create({ account: account.id, refresh_url: `${process.env.NEXT_PUBLIC_FRONTEND_BASE_URL}/stripe-payments`, // TODO: this page should try to fix the link-ing return_url: `${process.env.NEXT_PUBLIC_FRONTEND_BASE_URL}/stripe-payments?refresh_token=true&refresh_count=0`, // TODO: this page should try to fix the link-ing type: 'account_onboarding', collect: 'eventually_due', }) return NextResponse.json({ link: link }); } catch (error) { console.error("Internal Error:", error); // Handle other errors (e.g., network issues, parsing errors) return NextResponse.json( { error: `Internal Server Error: ${error?.message}` }, { status: 500 } ); } }
问题根源与解决方案
这不是Stripe的Bug,问题出在API调用的两个配置上:
Account Link的
collect参数设置
你当前设置的collect: 'eventually_due'会强制用户完成所有最终需要提交的信息,包括收款账户。如果要允许用户跳过非立即必需的信息,需要将该参数改为collect: 'currently_due',这样只会要求用户填写当前必须完成的合规信息,收款账户这类后续需要时再补充的内容就可以跳过。transfers能力的影响
你在创建账户时请求了transfers能力,对于部分国家/地区的Express账户,启用该能力会触发合规规则,要求提前配置收款账户。如果你的业务暂时不需要给关联账户转账,可以暂时不请求该能力,后续需要时再启用,也能避免强制要求银行账户信息。
修正后的关键代码片段
// 创建Account Link时修改collect参数 const link = await stripe.accountLinks.create({ account: account.id, refresh_url: `${process.env.NEXT_PUBLIC_FRONTEND_BASE_URL}/stripe-payments`, return_url: `${process.env.NEXT_PUBLIC_FRONTEND_BASE_URL}/stripe-payments?refresh_token=true&refresh_count=0`, type: 'account_onboarding', collect: 'currently_due', // 修改为该值 })
内容的提问来源于stack exchange,提问作者JustANoob
相关产品推荐
相关产品推荐

