#Bengomo

1 messages · Page 1 of 1 (latest)

open basinBOT
cloud copper
#

What do you mean by 'create a session with the secret key of a connected account'?

limpid crane
#

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

cloud copper
#

How are you redirecting client-side?

limpid crane
#

With loadStripe from stripe-js

cloud copper
#

You mean redirectToCheckout?

limpid crane
#

yes

#

sorry ^^

cloud copper
#

Ok, personally I wouldn't use that (its deprecated). The recommendation now is to either:

  • Redirect server-side.
  • Redirect client-side using the url field returned in the object.
limpid crane
#

Allright nice

cloud copper
#

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

limpid crane
#

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 !

cloud copper
#

Never use the API keys of your connected account(s) directly

limpid crane
#

Understood thanks a lot !

cloud copper
#

But generally redirectToCheckout is no longer recommended for a few reasons (doesn't support custom domains, for example)