#Zia

1 messages ยท Page 1 of 1 (latest)

stuck garnetBOT
violet spoke
#

๐Ÿ‘‹ happy to help

kindred shale
#

Hello Tarzan

#

we are using standard connected accounts
and creating checkout Session Ids and sending these ids to frontend

#

then frontend redirects and opens a checkout page for purchase

#

but it says that session not found

violet spoke
#

are you sending the ids or the URLs?

#

how are you redirecting?

kindred shale
#

we are sending ids

#

and using stripe.redirect on frontend

#

stripe
.redirectToCheckout({
sessionId: purchaseSessionId.checkoutSessionId
})

#

it says session not found

#

and when we add client referrence:

#

stripe
.redirectToCheckout({
sessionId: purchaseSessionId.checkoutSessionId,
clientReferenceId: purchaseSessionId.stripeStandardAccountId,
})

#

it says that Uncaught IntegrationError: stripe.redirectToCheckout: Do not provide other parameters when providing sessionId. Specify all parameters on your server when creating the CheckoutSession.

violet spoke
#

ok that's really not the way you should handle this

#

you should send the url and just redirect the window.location on the frontend

#

but in all cases there also another potential issue for future implementations that needs to be addressed

kindred shale
#

and what's that issue and that can be addressed

#

how that can be addressed*

violet spoke
#

depending on how you created the object on the backend (e.g. secret key of the platform + Connect Account Id) you need to use the equivalent configuration on the frontend (e.g. publishable key + Connect Account Id)

kindred shale
#

yes, we are using secret key of platform and passing standard account id in request options while creating checkout session

#

and sending the key to frontend
and then on frontend we are using stripe.redirect with same platform secret key

#

we were doing the same for custom connected accounts and it was working fine
but now we also needs to integrate standard connected accounts

paper hatch
#

Hey! Taking over for my colleague. Let me catch up.

kindred shale
#

hmm
ok

#

let me try this

#

every time we need to reinitialize stripe with new stripe account Id, right?

paper hatch
#

yes

neat forge
# kindred shale and sending the key to frontend and then on frontend we are using stripe.redirec...

HI ๐Ÿ‘‹ jumping in as my teammate needed to step away. I was coming to close the thread as the conversation seems to have settled, but I noticed this message that you sent. I wanted to clarify that you should not be sending a secret key to your frontend, that key needs to remain secret and should not be transmitted anywhere. If that secret key has been transmitted anywhere, then it should be rolled promptly:
https://stripe.com/docs/keys#rolling-keys

Use API keys to authenticate API requests.