#bruce-zhang_api

1 messages ¡ Page 1 of 1 (latest)

green totemBOT
#

👋 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/1217539805915648141

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

keen rapidsBOT
pine condor
keen rapidsBOT
rugged helm
#

yes it is. Thanks.

tall swan
#

Yes, you will need to pass a customer ID there

#

Also I deleted that message because your test mode secret key is sensitive and sometimes bots scrape servers like this looking for exposed API keys. There isn't a ton of harm anyone can do with your test mode secret key but it would probably be a good idea to roll it anyways

rugged helm
#

is there a way to get the customer id of the current user using code?

#

I am using next.js

#

The code I sent you is what I copied from the api reference, not my actual test key

tall swan
#

As in the user currenty on your webpage? Or something else

rugged helm
#

yes, we will redirect the first time user to buy a product on stripe checkout page, and they will become a customer and have a plan. We need an id for each user to open the corresponding portal for the user on stripe, like using an unique email, and each email can have a customer portal once they have subscribed

tall swan
#

Ah gotcha, so after the first time they check out there will be a customer property on the Checkout Session after it has completed. You can store that and assosciate it with the user on your site