#max_docs
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1415423749158862979
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello there
If you want the processing fees to be assessed on your Connected Accounts then you would use the Stripe Dashboard access with Direct Charges.
I'm honestly quite lost with all the documentation and it's very though to follow a simple thread to get to what I want ๐ฅฒ
Well I'm happy to help if you have specific questions
Can I just try to walk you through what I understand of the doc and you can confirm if that would work then I can ask some follow up questions about how to migrate from my current implementation?
Sure let's start there
Alright so for context, the way it's currently implemented in my app:
Organization => OAuth connection => app saves accountId => Create payment intent with the current code
amount: chargeFees ? totalCharge : amount,
currency: currency || 'cad',
application_fee_amount: application_fee_amount + stripeFee,
on_behalf_of: accountId,
transfer_data: {
destination: accountId,
},
payment_method_types: ['card'],
description,
metadata,
})```
The org can choose to pass on the fees to the user or not. (they are aware the amount calculated to pass it on to the user is not gonna be perfect).
I was advised to add the stripeFee I'm calculating to `application_fee_amount` when I reached out to support because I was paying stripe fees due to poor configuration and kept losing money on every transaction. This is a bandaid fix as I want my connected account to be paying the fees and only take off my application_fee_amount off of it.
Okay and what type of Connected Accounts are you currently working with?
I believe it's standards..? I don't create the accounts for them, they link existing accounts if they have one or create a new one if needed
Yep that would be Standard then. In which case you are in a good spot to switch to Direct Charges.
Basically you just need to adjust your integration to using the Stripe Account Header and remove the transfer_data hash. See: https://docs.stripe.com/connect/direct-charges
oh so I just shouldn't have gone the route of the manual paymentIntent creation
You still create PaymentIntents
You do everything the same except that instead of creating them on your platform account you create them directly on the Connected Accounts.
oh wait I just changed to the custom flow and it's more similar to what I'm using
Yeah Stripe Checkout is just the default tab there
right so the key difference is , { stripeAccount: '{{CONNECTED_ACCOUNT_ID}}', }
Yes
you're a lifesaver hahaha
And client-side you need to also initialize as the Connected Account, see: https://docs.stripe.com/connect/authentication#add-the-connected-account-id-to-a-client-side-application
(I assume you are confirming client-side here)
I really didn't want to have to deal with rebuilding the integration of accounts. I will have to handle creating accounts for my merchants eventually by default so they can hit the count running, but today was not hte day
Yeah no need to do that here.
ok gotcha, so if I'm understanding correctly, everything is done on behalf of the connectedAccount by initializing both the Stripe integration and the paymentIntent specifying the stripeAccount as the second parameter and it'll be linked to my account through the secret/public keys
Yep
And you remove transfer_data as you are no longer creating a Transfer
Next step is to go test this out in test mode
Should be quite quick to test
perfect, do I still need on_behalf_of to handle cases for cross-border merchants? assuming not as they're the ones "handling" the payments
No you do not
Correct, you would remove on_behalf_of for those cases as well.
By creating the PaymentIntent on the Connected Account it makes the Connected Account the Merchant of Record
(Same as what on_behalf_of was doing)
alright that makes sense
ok I'll take a look at my code and update that quickly to give it a shot
๐
loading Stripe on my frontend I use loadStripe outside of my react component and pass it to the stripe components, at that point my paymentIntent is already created. just confirming, that still needs to initialize loadStripe with the stripeAccount?
Yes
Since the object exists on the Connected Account if you don't initialize as that Connected Account then you will get an error about the object not existing.
gotcha
alright I'll have a bit more refactoring to do then, I'll get to it, thank you so much
Sure thing
on the backend, I need to add the stripeAccount essentially everywhere that a payment intereaction my occur? confirming, retrieving, etc.
Yeah anytime you are handling any object on the Connected Account you need the Stripe Account header set.
Which will be pretty much always here
seems to be working! I'll deploy to production and monitor
would you happen to know how to delete test accounts? I have 5 different ones because I wasn't careful with the connect flow ๐
You can delete all test data but otherwise you can't.
Unless you log into those accounts and delete that way
But I assume they are just test-only accounts
yeah, but I have 5 different test-only accounts with the same name ๐ญ