【问题标题】:Stripe Connect create accounts from serverStripe Connect 从服务器创建帐户
【发布时间】:2020-04-15 11:25:12
【问题描述】:

我正在尝试在用户注册时使用我的 Firebase 功能后端创建条带连接帐户,但一直收到此错误 Express accounts may only be created via the OAuth flow 我知道该错误似乎不言自明,我需要使用标准 OAuth 注册方法,但是在Documentation 中,它声明自定义类型可以由 API 创建,并为每个只想发送资金而不接收的用户提供 OAuth,这很烦人,我是否为 API 做错了而不是创建它?或者是否有一种解决方法不必为只想发送资金的用户显示 OAuth?

exports.createStripeCustomer = functions.auth.user().onCreate(async (user) => {
const customer = await stripe.customers.create({email: user.email});
const account = await stripe.accounts.create({type: 'custom', business_type: 'individual', individual: {email: user.email}, requested_capabilities: ['card_payments', 'transfers'], email: user.email});
return admin.firestore().collection('stripe_customers').doc(user.uid).set({account_id: account.id, customer_id: customer.id});
});

【问题讨论】:

    标签: stripe-payments


    【解决方案1】:

    使用 Connect 时,Express 帐户和自定义帐户是 distinct types of accounts。您可以创建自定义帐户using the API,但快速帐户必须是created via OAuth

    主要区别在于 Express Accounts 可以访问 Stripe Dashboard 并且可以由最终用户以某种方式进行更新,而 Custom Accounts 则完全由平台管理。

    【讨论】:

    • 我以为我在指定类型时创建了一个自定义帐户
    • 当您指定 { type: "custom" } 时,您正确地请求自定义帐户。不过,听起来您可能没有按照您期望的方式提出请求。我建议联系Stripe Support 或查看 Freenode (IRC) 上的#stripe,因为他们可以查看实际的请求日志以查看实际呼叫中发送的内容。
    【解决方案2】:

    这个问题似乎是由于我没有在 stripe.accounts.create 函数中指定国家/地区引起的。完成后,我创建了帐户。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-09-30
      • 2021-06-24
      • 2021-03-30
      • 2021-07-13
      • 2020-11-06
      • 2021-05-15
      • 2015-04-17
      • 2017-12-16
      相关资源
      最近更新 更多