#jose-standard-destination

1 messages ยท Page 1 of 1 (latest)

hard slateBOT
agile agate
#

@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

lucid turtle
#

So i erase the transfer_data object?

#

I am very confused on this

agile agate
#

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

lucid turtle
#

Can i share my full code on here?

agile agate
#

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

lucid turtle
#

well i am confused on how to manage it, right now im using const session = await stripe.checkout.sessions.create({

agile agate
#

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

lucid turtle
#

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

hard slateBOT
lucid turtle
#

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

agile agate
#

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

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

outer furnace
#

๐Ÿ‘‹ stepping in as koopajah needs to step away

lucid turtle
#

thanks, im sorry i wasnt clear enough

outer furnace
#

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)

lucid turtle
#

Thanks, but here it says i need to use const paymentIntent = await stripe.paymentIntents.create(

outer furnace
#

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

lucid turtle
#

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

outer furnace
#

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

lucid turtle
#

:/

outer furnace
#

What are you confused by specifically?

lucid turtle
#

What should i includein this code, the paymentIntent?

#

Well, im using session.url

outer furnace
#

Right, that means you are using Stripe Checkout, our hosted checkout page.

lucid turtle
#

Where do i specify this you are telling me

#

Yes correct

outer furnace
#
  success_url: 'https://example.com/success',
  line_items: [
    {price: 'price_H5ggYwtDq4fbrJ', quantity: 2},
  ],
  mode: 'payment',
}, {
    stripeAccount: '{{CONNECTED_ACCOUNT_ID}}',
  }
);```
lucid turtle
#

thats why im confused, since i already tried to include the stripeAccount key on this object

#

And says its wrong

outer furnace
#

That's not an options object

#

That is just passing it as a parameter

lucid turtle
#

oh ok

outer furnace
#

I provided you an example above

lucid turtle
#

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

lucid turtle
#

ok i should remove on_behalf_of and transfer_data, and just leave the application fees

outer furnace
#

Yep

lucid turtle
#

  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
}
outer furnace
#

Seems fine to me. Test it out

lucid turtle
#

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?

outer furnace
#

Yep, best thing to do is test it out

lucid turtle
#

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?

outer furnace
#

Yes the Stripe fee is taken from where the charge takes place, which is the Connected Account

lucid turtle
#

so, in matter of fact if i charged 5% and return $95 of 100, then the connected account get charged of that $95 usd?

outer furnace
#

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