#cemsozens_api

1 messages ยท Page 1 of 1 (latest)

sly arrowBOT
#

๐Ÿ‘‹ 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.

tepid minnowBOT
stable dome
#

Hello

little sorrel
#

Hi!

stable dome
#

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.

little sorrel
#

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

stable dome
#

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?

little sorrel
#

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

stable dome
#

Okay and who's information should the customer see on their credit card statements? Your marketplace or your vendors?

little sorrel
#

We will use the payment method that vendor provides us

stable dome
#

Not sure what you mean by that. Who does the end-customer think they are purchasing from? You or the vendor?

little sorrel
#

Sorry there is no end-customer in our case. We provide advertisement support for marketplaces. So the end user is vendors in our case

stable dome
#

So to clarify the vendors are your customers and they are just paying you directly.

#

There is no third-party involved

little sorrel
#

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

stable dome
#

Ah okay so you are a platform for marketplaces (the Connected Accounts) and they are charging vendors

little sorrel
#

yes exactly

stable dome
#

So the vendors think they are paying the marketplaces directly

little sorrel
#

exactly

stable dome
#

And you are going to use Standard Connected Accounts here

little sorrel
#

yes i guess so

stable dome
#

So you do want to be creating the PaymentMethod directly on the Connected Account as well

little sorrel
#

Yes true

stable dome
#

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?

little sorrel
#

Not sure if i fully understand sorry.

stable dome
#

Are you going to charge the vendor at the same time you collect their PaymentMethod?

little sorrel
#

yes we want that

stable dome
#

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

little sorrel
#

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?

stable dome
#

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

stable dome
little sorrel
#

Thanks i will get back to you once i take a deeper look

stable dome
#

๐Ÿ‘

sly arrowBOT