#jose-standard-destination
1 messages ยท Page 1 of 1 (latest)
@lucid turtle When using Standard accounts you should never be using Destination Charges.
jose-standard-destination
You are supposed to use Direct Charges instead where the payment is created on the connected account, they pay the Stripe fee and they own all liability for Refunds and Disputes
There are different flow of funds with Connect and you're using the wrong one. See https://stripe.com/docs/connect/charges
You are using Destination Charges and you should be using Direct Charges. They are quite different in the integration pattern so you need to carefully read the docs to migrate to the right flow
Can i share my full code on here?
You can but there's no reason to share the full code. The first step is for you, as a developer to carefully read the docs first
well i am confused on how to manage it, right now im using const session = await stripe.checkout.sessions.create({
Sorry I get you're confused but you haven't really asked a concrete question per se. You just asked "do I remove this" without carefully thinking about it as a developer and reading both docs to see the difference.
The docs have a clear diagram of the flow of funds and where objects exist.
With Destination Charges everything lives on your platform. With Direct Charges they get created on the connected account. So it changes the overall code where you remove transfer_data and on_behalf_of and instead you use the Stripe-Account header https://stripe.com/docs/connect/authentication#stripe-account-header to make the requests on that connected account
Well, since i need to create a session.url thats why im asking, because my function returns a sesison.url, and I dont know if what your are telling me to do its on the right path
I know as a developer I should read all the docs, but thats not the support I really asking. I thought you guys can guide me into what i need
I am explaining it in details, but you do have to do your part reading the docs, understanding the context, understanding your own code and asking clear questions @lucid turtle
Anything you told me has to do with the fact im using checkout.sessions.create? Or i should use another stripe function
For me its going to be very complicated if i use other function
๐ stepping in as koopajah needs to step away
thanks, im sorry i wasnt clear enough
Sounds like you mistakenly are using Destination Charges instead of Direct Charges. Stripe Checkout still works fine here, you just want to create the Checkout Session on your Connected Account (see: https://stripe.com/docs/connect/authentication for how to do that) and then take an application fee for your platform's cut, instead of creating Transfers (via transfer_data)
Thanks, but here it says i need to use const paymentIntent = await stripe.paymentIntents.create(
Nope, that is just an example
Notice how the Stripe Account Header is passed
That is the part you want to apply to your Checkout Session creation code
I am so confused, im so sorry, i think i need to chatgpt this
I created this stripe integration with help of another app, so i need to undertand how stripe works i think
Yeah sorry, we can't write your code for you.
You do need to read the docs and work on understanding the whole picture
I'm happy to help with specific questions
:/
What are you confused by specifically?
Right, that means you are using Stripe Checkout, our hosted checkout page.
https://stripe.com/docs/connect/authentication#stripe-account-header has examples in each of our client libraries for how to pass the Stripe Account Header. So for node for instance, you add an options object and pass: { stripeAccount: '{{CONNECTED_ACCOUNT_ID}}', }
success_url: 'https://example.com/success',
line_items: [
{price: 'price_H5ggYwtDq4fbrJ', quantity: 2},
],
mode: 'payment',
}, {
stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
}
);```
thats why im confused, since i already tried to include the stripeAccount key on this object
And says its wrong
oh ok
I provided you an example above
i get it
i didnt see your msg sorry
So i get out the payment_intent_data
So where do i put the app fees
ok i should remove on_behalf_of and transfer_data, and just leave the application fees
Yep
const session = await stripe.checkout.sessions.create({
mode: 'payment',
payment_method_types: ['card'],
line_items: lineItems,
payment_intent_data: {
application_fee_amount: Math.floor(amount * 0.05),
},
success_url: `${domainUrl}/payment/success?${queryString}`,
cancel_url: `${domainUrl}`,
}, {
stripeAccount: stripeAccountId,
})
return session.url
}
Seems fine to me. Test it out
I will, you are very kind @outer furnace
thanks for the patience
So just to be clear, on a $100 payment. the application fee is 5% so it would be $5. So the connected account will receive $95 and i would keep the $5?
Yep, best thing to do is test it out
Ok, right now i paid 100
But my balance -227 remains the same
And on my connected account i received not the $95
So now, the connected accounts assume the stripe fee?
Yes the Stripe fee is taken from where the charge takes place, which is the Connected Account
so, in matter of fact if i charged 5% and return $95 of 100, then the connected account get charged of that $95 usd?
I don't know what you mean by that, but at this point the best thing to do is to run tests to understand the behavior