分条连接多个目标帐户ID

我们可以创build付款并通过NodeJS中的Stripe连接向application_fee收费, 如下所示 :

// Get the credit card details submitted by the form var token = request.body.stripeToken; // Create the charge on Stripe's servers - this will charge the user's card stripe.charges.create( { amount: 1000, // amount in cents currency: "eur", source: token, description: "Example charge", application_fee: 123 // amount in cents }, {stripe_account: CONNECTED_STRIPE_ACCOUNT_ID}, function(err, charge) { // check for `err` // do something with `charge` } ); 

可以使用Stripe本地签出处理程序获取源代码。

但是,如果我有一个市场,并且想要执行多个作者不同作品的结帐,那么我将如何继续?

问题是我需要从一个来源创build多个费用。 但是,系统会认为总数(在检索stripeToken源时使用)与个别金额(各个项目)不匹配时会出现错误。

一次收费不能在多个账户之间分摊。

1)您需要将令牌保存到平台帐户中的客户。 2)使用“共享客户”为每个要创build费用的帐户创build一个新的令牌

 // Create a Token from the existing customer on the platform's account stripe.tokens.create( { customer: CUSTOMER_ID, card: CARD_ID }, { stripe_account: CONNECTED_STRIPE_ACCOUNT_ID }, // id of the connected account function(err, token) { // callback } 

3)使用新的令牌创build与您的问题中的代码负责