#yogeba.

1 messages · Page 1 of 1 (latest)

stable stormBOT
sweet sparrow
#

How are you creating Connect payments today?

hybrid fable
#

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.

sweet sparrow
#

Guide there outlines the full flow

hybrid fable
#

Got it. So we need to completely remove payment_intent_data from here and move the logic post payment success.. Correct?

sweet sparrow
#

Yep, exactly

hybrid fable
#

Awesome.. Thanks

sweet sparrow
hybrid fable
#

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?

sweet sparrow
#

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

hybrid fable
#

Ahh Got it. Thanks again. Have a nice day.