这是我的用例:
首先,用户使用react-stripe-checkout https://www.npmjs.com/package/react-stripe-checkout
支付100美元我处理NodeJS服务器上的逻辑:
所以!我想要这样:
1-创建对主科目条(A)的费用(100 $)。
<?xml version="1.0" encoding="utf-8"?>
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android">
<changeImageTransform />
</transitionSet>
然后,我想创建$ 30到另一个条带化帐户的转帐
await stripe.charges.create({
amount: 100000, currency: 'USD', source: args.token,
});
或
await stripe.paymentIntents.create({
payment_method_types: ['card'], amount: 3000, currency: 'USD', }, { stripe_account: 'acct_xxx ',
});
像这样是正确的还是需要激活关联帐户,我必须为此付费?
所以我有一个**错误:没有这样的帐户:acct_xxx **
实现它的最好方法是什么?
答案 0 :(得分:0)
Stripe Connect's separate charges and transfers是为此用例设计的。实际上,one of the primary examples on that page与您的问题非常相似:
假设这代表一项送货服务交易,向客户收取100美元的费用,向送货人员转移20美元,向餐厅转移70美元[...]
这是该页面上的Node示例代码:
// Create a PaymentIntent:
const paymentIntent = await stripe.paymentIntents.create({
amount: 10000,
currency: 'usd',
payment_method_types: ['card'],
transfer_group: '{ORDER10}',
});
// Create a Transfer to the connected account (later):
const transfer = await stripe.transfers.create({
amount: 7000,
currency: 'usd',
destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
transfer_group: '{ORDER10}',
});
// Create a second Transfer to another connected account (later):
const secondTransfer = await stripe.transfers.create({
amount: 2000,
currency: 'usd',
destination: '{{OTHER_CONNECTED_STRIPE_ACCOUNT_ID}}',
transfer_group: '{ORDER10}',
});