如何使用Node.js从不同的客户Stripe批量处理多笔费用?

问题描述 投票:0回答:1

我想从一组客户那里收取费用,然后同时转移关联帐户的费用,我在条带中搜索事务或批处理之类的东西,但我什么都没找到。image解释了我想要准确地制作

stripe.paymentIntents.create({
amount: 2000,
currency: 'eur',
payment_method_types: ['card'], },
  function(err, paymentIntent) {
  });
node.js stripe-payments batch-processing
1个回答
0
投票

n收费的建议流程是通过Stripe API创建n PaymentIntents。您将为每个PaymentIntent创建一个Customers,并且可以使用metadata将它们连接到您自己的系统中(Stripe跟踪键值metadata对,并且您可以使用它们来协调每个[ C0],而不是您自己跟踪每次付款中的PaymentIntent组。]

例如,如果您有两(2)个Customers均分Customers,并且关联帐户的amount: 2000id

acct_123abc

您可以使用自己的内部付款ID代替['cus_abc123', 'cus_xyz789'].forEach(customer_id => { stripe.paymentIntents.create({ amount: 1000, currency: 'eur', payment_method_types: ['card'], customer: customer_id, transfer_data: { destination: 'acct_123abc' }, metadata: { my_internal_id: 'internal_payment_id' } }).then(payment_intent => { console.log(payment_intent.id); }).catch(err => console.log(err)); }); }); 中的“ internal_payment_id”,将每个metadata绑定到您自己系统中的付款。

© www.soinside.com 2019 - 2024. All rights reserved.