簡體   English   中英

Stripe Node.js - 如何在多個受益人(關聯賬戶)之間拆分付款?

[英]Stripe Node.js - How to split a payment between several beneficiaries (connected accounts)?

對於我的第一個實現,我將交易金額從我的應用程序 (Flutter) 中檢索到的 paymentMethod Id 直接轉移給受益人。 現在我的目標是在同一筆交易的幾個受益人之間分攤付款。

第一個實現代碼:

var clonedPaymentMethod = await stripe.paymentMethods.create(
        {
          payment_method: paym,
        },
        {
          stripeAccount: stripeVendorAccount,
        }
      );

var paymentIntent = await stripe.paymentIntents.create(
          {
            amount: amount,
            currency: currency,
            payment_method: clonedPaymentMethod.id,
            confirmation_method: "automatic",
            confirm: true,
            application_fee_amount: fee,
            description: "desc",
          },
          {
            stripeAccount: stripeVendorAccount,
          }
        );
const paymentIntentReference = paymentIntent;

通過查看文檔,我注意到stripe.paymentMethods.create方法不再被指定,而stripe.transfers.create方法被添加了。

此代碼試圖將付款方式克隆到已連接的帳戶,然后在該帳戶上創建直接費用。 為了創建費用,然后將該費用的資金拆分到單獨的關聯賬戶,需要采用不同的方法。 model 將更接近“單獨收費和轉賬”,在該平台上進行收費,然后使用轉賬在關聯賬戶之間共享一些金額。 此處概述了完整的描述 [1]。

[1] https://stripe.com/docs/connect/charges-transfers

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM