#yogeba.
1 messages · Page 1 of 1 (latest)
How are you creating Connect payments today?
Hey, I am from same team. We are using Next.js... This is existing piece of code that we are using
const params: Stripe.Checkout.SessionCreateParams = { customer_email: user.emailAddresses[0].emailAddress, line_items: [ { price_data: { currency: CURRENCY, product_data: { name, images, }, unit_amount: amount, }, quantity: 1, }, ], mode: "payment", cancel_url:${cancel_url}`,
payment_intent_data: {
application_fee_amount: Math.round(amount * 0.05),
transfer_data: {
destination: hostStripeAcountId,
},
transfer_group: reservation.id,
},
};`
Just removed a few sensitive info's ...
now the point where we are stuck is we have multiple account's where we have to disperse the amount after cutting our fee.. e.g. to simplify 50% in one and 25% in one and 25% in one.
Yep, you can't use the Connect parameters like transfer_data to split to multiple accounts. You need to do separate transfers after the payment: https://stripe.com/docs/connect/creating-a-payments-page?platform=web&ui=checkout&destination-or-direct=separate-charges-transfers
Guide there outlines the full flow
Got it. So we need to completely remove payment_intent_data from here and move the logic post payment success.. Correct?
Yep, exactly
Awesome.. Thanks
You'd create the Transfers to the accounts manually: https://stripe.com/docs/connect/creating-a-payments-page?platform=web&ui=checkout&destination-or-direct=separate-charges-transfers#transfer
Also, is there a better way to calculate stripe fee.. We have customers from both India and outside India using cards issued in India and outside India.
Since we are using Stripe-hosted page we don't know the fee before payment and we want to collect this fee from users (who are making the payment). Is there a better way to do this instead of using a flat fee for everyone?
You'd need to manyally calculate the fee if that's important to you I'm afraid
What most do is charge a generic processing fee that covers the Stripe fee regardless of payment method type/country etc
Ahh Got it. Thanks again. Have a nice day.