Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/99.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Stripe.js(iOS)为Stripe Connect支出创建外部账户_Ios_Node.js_Stripe Payments_Stripe Connect_Stripe.js - Fatal编程技术网

使用Stripe.js(iOS)为Stripe Connect支出创建外部账户

使用Stripe.js(iOS)为Stripe Connect支出创建外部账户,ios,node.js,stripe-payments,stripe-connect,stripe.js,Ios,Node.js,Stripe Payments,Stripe Connect,Stripe.js,我正在尝试将实际银行帐户连接到stripe connect中的stripe帐户 然而,我正在为实际的实现而挣扎 我使用自定义帐户,因此我希望通过iOS应用程序向用户提供帐户创建逻辑 在Stripe API参考中,它指出实现这一点的推荐方法是: “在创建或更新自定义帐户时,通过external_accounts参数添加目标帐户。该值应为Stripe.js返回的银行帐户或借记卡令牌。” 创建令牌的文档记录如下(我使用的是NodeJS): 在帐户创建过程中,我在何处链接该令牌?参见下面的相关代码: a

我正在尝试将实际银行帐户连接到stripe connect中的stripe帐户

然而,我正在为实际的实现而挣扎

我使用自定义帐户,因此我希望通过iOS应用程序向用户提供帐户创建逻辑

在Stripe API参考中,它指出实现这一点的推荐方法是: “在创建或更新自定义帐户时,通过external_accounts参数添加目标帐户。该值应为Stripe.js返回的银行帐户或借记卡令牌。”

创建令牌的文档记录如下(我使用的是NodeJS):

在帐户创建过程中,我在何处链接该令牌?参见下面的相关代码:

app.post('/create_account', (req, res) => {
console.log('create account called');
var email = req.body.email;
var firstname = req.body.firstname;
var lastname = req.body.lastname;

stripe.accounts.create({
    country: "CH",
    type: "custom",
    email: email,
    business_name: "examplename",
    legal_entity: {
        first_name: "firstname",
        last_name: "lastname",
        dob: {
            day: 1,
            month: 1,
            year: 1900
        }
    }

}).then((account) => {
    res.status(200).send(account)
}).catch((err) => {
    console.log(err, req.body)
    res.status(500).end()
});
});
令牌创建只是验证客户端帐户信息的一种方法吗


如果有人能用简单的一步一步的解释来详细说明这一点,我会很高兴,提前谢谢你

您将在参数中传递令牌:

var bankAccountToken = req.body.stripeToken;

stripe.accounts.create({
  country: "CH",
  type: "custom",
  // ...
  external_account: bankAccountToken,
}).then((account) => {
  // ...

我确实将“stripe.accounts.create”方法放在了“stripe.createToken”的结果函数中(如果没有错误)。从那里,我将令牌直接传递给外部帐户密钥。这样做合适吗?另外,我的日志上写着:“TypeError:stripe.createToken不是一个函数”,问题出在哪里?与这行有什么关系吗:js.stripe.com/v3/“>?谢谢你!Ywain!@BesfortAbazi应该使用stripe.js在客户端代码中创建令牌。然后你会发送令牌ID(“btok”…)到您的后端服务器,并使用它在服务器端Node.js代码中创建帐户。您是否介意简要解释如何在客户端实现代码?我没有找到关于如何在iOS(Objective-C)中专门实现此操作的文档app.这是一个合适的解决方案吗?@BesfortAbazi是的,如果您的客户端是iOS应用程序而不是web应用程序,您需要使用Stripe的iOS SDK标记支付信息。您可以在此处阅读所有相关内容:
var bankAccountToken = req.body.stripeToken;

stripe.accounts.create({
  country: "CH",
  type: "custom",
  // ...
  external_account: bankAccountToken,
}).then((account) => {
  // ...