我们可以在 NodeJS 中使用 Stripe connect 创建付款并收取 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 原生结账处理程序获取源代码。
但是,如果我有一个市场并且我想对具有不同作者的多个项目执行结帐,那么我将如何进行?
问题是我需要从一个来源创建多个费用。但随后系统会认为存在错误,因为总金额(在检索 stripeToken 源时使用)与单个金额(单个项目的)不匹配。