#Bengomo
1 messages · Page 1 of 1 (latest)
What do you mean by 'create a session with the secret key of a connected account'?
You shouldn't use using secret keys of connected accounts directly. Instead, you'd use your platform key and use the Stripe-Account header: https://stripe.com/docs/connect/authentication
So basically, I have one main account and two connected accounts. When trying to create a payment session, i'm passing in the header the connected account id.
While this session is created succesfully, on the client side i'm trying to access the stripe payment page but get this error :
My guess is because the client side uses stripe js with the main account public key
How are you redirecting client-side?
With loadStripe from stripe-js
You mean redirectToCheckout?
Ok, personally I wouldn't use that (its deprecated). The recommendation now is to either:
- Redirect server-side.
- Redirect client-side using the
urlfield returned in the object.
Allright nice
If you do want to use redirectToCheckout then yes, you will need to initialise Stripe.js with your platform keys and pass the stripeAccount param
so with redirectToCheckout i'll need to get the public key from the connected account on the clientSide so that stripe recognises the session being used ?
oh okay got you
Thanks a lot btw i'm all good 🙂 Have a good rest of your day !
No, you use the pk_xxx from your platform account and pass the account ID (acct_xxx) to stripeAccount when initialising
Never use the API keys of your connected account(s) directly
Understood thanks a lot !
But generally redirectToCheckout is no longer recommended for a few reasons (doesn't support custom domains, for example)