Search code examples
javascriptnode.jsstripe-paymentsstripes

Is there really a way to send payment to another stripe account user?


I am struggling to see how this can be achieved. I have a system in place that uses stripe connect standard account. This is how it works: I am a building a platform in nodejs and Nextjs where users can create trips for others to book and pay fully or via payment plan. This is working now. I used the stripe connect standard account to handle this while the owner takes certain commission and send the balance of the payment to the owner of the trip instantly once a booking is made.

Here is a sample working code:

const paymentIntent = await stripe.paymentIntents.create(
{
    amount: Number(params.amount),
    currency: params.currency,
    automatic_payment_methods: {
        enabled: params.automatic_payment_methods?.enabled as boolean,
    },
    customer: params.customerId,
    off_session: true,
    confirm: true,
    payment_method: params.paymentMethodId,
    application_fee_amount: Number(300), 
    metadata: params?.metaData as Stripe.MetadataParam,
    description: params?.description
},
{
    stripeAccount: params?.stripeConnectAccount,
});

The trip creators were onboarded via stripe standard connect account flow. The challenge noow is that we want to onboard another type of users called affiliate users. Affiliate users simply promote trips and if someone books a trip via their custom affiliate link, we would like them to earn commission like $50 for example. But we also dont want them to be able to withdraw the money until after let say 30 days or certain condition is met. I have thought of stripe express connect account type for this. However, how do I get this done since from my little understanding, connect accounts work when there is a billing made. The billing has already happened when the booking was made and the trip creator is a standard connect account type user who gets his money instantly, is there a way to add another stripe connect setup to this? Is it possible to transfer money to two different stripe connect account? Is it possible to hold one for days while one can be released instantly?

We have implemented the stripe connect standard account type for trip creators.


Solution

  • You'd need to use Separate charges and transfers approach (which, fair warning, is quite a bit more complex) to be able to support both types of users. You'd process a payment on your platform and then you can use the Transfers API to send funds from that payment to each type of account.

    https://stripe.com/docs/connect/charges#types

    Note this also significantly changes how the payment processing works since now it's your platform account who is charging the customer and is liable for Refunds/Disputes (in your current model it's the Standard account who is).