#cemsozens_api
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/1230228569221763287
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Hi!
To clarify, using on_behalf_of still means you are doing everything on your platform account -- it just changes the settlement merchant to the Connected Account but you still handle all Events on your platform through a direct Webhook endpoint.
Thanks and there is a second part of the problem. When i use 'stripe-account' param in the call it then fails because it cannot find the payment method
Correct because you are creating the PaymentMethod on the platform so it doesn't exist on the Connected Account
But you shouldn't be trying to use it on the Connected Account at all if you are using on_behalf_of
So what are you really trying to do here?
Ah it does look like you are working with Standard Connected Accounts, yes?
What i am trying to achieve is as follows: I have a marketplace which connects to my account and this marketplace also has vendors inside. I want to charge vendors on behalf of marketplace
The money will be transferred to marketplace account
I am just initiating the payment when some conditions
Okay and who's information should the customer see on their credit card statements? Your marketplace or your vendors?
We will use the payment method that vendor provides us
Not sure what you mean by that. Who does the end-customer think they are purchasing from? You or the vendor?
Sorry there is no end-customer in our case. We provide advertisement support for marketplaces. So the end user is vendors in our case
So to clarify the vendors are your customers and they are just paying you directly.
There is no third-party involved
We want vendors to pay marketplaces. Not us. We just want to initiate a payment on behalf of marketplaces to charge vendors. We wont recieve any money. The money should go to marketplaces stripe account
Ah okay so you are a platform for marketplaces (the Connected Accounts) and they are charging vendors
yes exactly
So the vendors think they are paying the marketplaces directly
exactly
And you are going to use Standard Connected Accounts here
yes i guess so
Alright well in that case you do want to use Direct Charges (see: https://stripe.com/docs/connect/direct-charges) and not use on_behalf_of.
So you do want to be creating the PaymentMethod directly on the Connected Account as well
Yes true
Let me look at what flow you are using right now
One sec
Ah okay you are collecting via a SetupIntent first
Do you anticipate charging later after collection?
As opposed to charging at time of collection?
Not sure if i fully understand sorry.
Are you going to charge the vendor at the same time you collect their PaymentMethod?
yes we want that
Okay then you shouldn't be using a SetupIntent at all
So what you want to do is create a PaymentIntent on your Connected Account using the Stripe Account Header. Then you intialize client-side as the Connected Account and render Payment Element for the Connected Account. See: https://stripe.com/docs/connect/authentication for how to initialize as the Connected Account both server-side and client-side.
This allows you to collect the PaymentMethod and charge it at the same time. If you want to save the PaymentMethod for future use as well then you pass setup_future_usage (https://docs.stripe.com/api/payment_intents/create#create_payment_intent-setup_future_usage) and a Customer ID (https://docs.stripe.com/api/payment_intents/create#create_payment_intent-customer) when you create your PaymentIntent
but the problem is when i pass stripe-account it complains as "No such PaymentMethod: 'pm_xxx'; OAuth key or Stripe-Account header was used but API request was provided with a platform-owned payment method ID. Please ensure that the provided payment method matches the specified account."
Could it be that vendor account is connected to my account and not the marketplace account?
Yep that is because you created the PaymentMethod on the platform. If you do what I wrote above then the PaymentMethod will be created on the Connected Account
No it has to do with which account you create the objects on. You control this with your code/integration.
Thanks i will get back to you once i take a deeper look
๐