#y3ll0wFlash

1 messages · Page 1 of 1 (latest)

wispy topazBOT
agile summit
#

👋 happy to help

#

would you mind sharing the request id where you had this issue?

subtle oak
#

Sure
req_zCmREnl6lgwJxs

agile summit
#

do you have a request id where this is working for you?

subtle oak
#

Sure. here is one from another connect account that seems to be working
req_vU37NGZJdbjCd4

agile summit
#

I'm looking at the difference between the two accounts

#

oh sorry I just realized that you've passed the customer to this request req_zCmREnl6lgwJxs as the Platform account and not as a Connected Account

#

you need to always pass Stripe-Account id to authenticate as a Connect Account when using customer in the tokens API

subtle oak
#

customer is passed in both of these requests so shouldn't it raise the error in both of these cases?

#

or do you mean that in the failing request, the customer id is actually the ID of the platform account and not of any connected account?

rotund bridge
#

no, because the other case is a special case since it's cloning a card from the customer on the platform. In that specific endpoint with those specific parameters you can make a request on a connected account but refer to a customer on a platform, but not in any other context

rotund bridge
#

your broken example is you making that API call but not doing it correctly (not passing the Stripe-Account option)

subtle oak
#

do you think it's a bug?

rotund bridge
#

not really

#

the ID is passed as a HTTP header, not a POST parameter

#

maybe that's what confuses you

#

there's no bug here on our side

subtle oak
#

Sorry I had sent a screenshot alongwith this msg but that wasn't uploaded. so apologies for the confusing msg.

I just checked the stripe's source code and how we send the account ID. I can confirm that we are indeed sending the account ID

#

Does stripe dashboard show request headers at any place? where we can confirm this from?

rotund bridge
#

I saw the screenshot, no worries

#

I just checked the stripe's source code and how we send the account ID. I can confirm that we are indeed sending the account ID
you don't need to look at our code, not sure why you're doing that

rotund bridge
#

let's take a step back. What's your actual question or what are you stuck with right now?

subtle oak
#

Alright,
so with some accounts, our payments are getting passed, but for some accounts we are getting this Must authenticate as a connected account to be able to use customer parameter error.

rotund bridge
#

yep, because you're not passing Stripe-Account in your code when making that API call.

#

do you have a request ID req_xxx for an error?

subtle oak
#

req_zCmREnl6lgwJxs is a failing request.

but I just checked in sentry logs and we are sending the stripe account to stripe SDK.

rotund bridge
#

yep, you are

#

but it does nothing, since the secret key you pass is the secret key of that same account

#

the way it should work is

  • you use the secret key of your platform account
  • you pass Stripe-Account set to the account ID of a connected account
#

here for some reason you use the wrong key/ID, so it looks to me like what you do is

  • you use the secret key of your platform account
  • you pass Stripe-Account set to the account ID of your own platform account

which is just the same as not passing Stripe-Account , and just runs the request on your own account.

subtle oak
#

ah i see

rotund bridge
#

acct_1C3szRCPJwTYUbmR is the ID of your platform account, not one of your connected accounts.

subtle oak
#

so I should basically have one more connected account created and use that instead of the main platform account

rotund bridge
subtle oak
#

Got it. so either:

  • I can't use this same flow (clone users) if I use the platform account
  • or I create a new connected account
#

right?

rotund bridge
#

right. I'm not sure what your overall goal is so it depends

#

if you're just trying to have your platform charge the customer's saved details that exist in your platform you don't need to do any cloning or enter the part of your code that does that and tries to make that API call

subtle oak
#

so our platform has multiple tenants where each tenant can charge the customers. Payments go directly to the connected accounts'.

rotund bridge
#

cool, and that all works for you?

#

i.e. you do Direct Charges by cloning cards from the platform account to the connected account, and process payments there? That's a normal enough integration and seems like what you use based on our discussion.

subtle oak
#

Yep that sounds about right

#

Thanks for the assistance @rotund bridge !!!