#sidorela_checkout-session
1 messages ยท Page 1 of 1 (latest)
๐ 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/1245661638489800766
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
When you receive that event, you can make an API call to retreive the Checkout Session details and exapnd the line_items field:
https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-line_items
You'll have the Product/Price the customer purchased
sidorela_checkout-session
so in this case in mongodb function I have to call an api like this
/v1/checkout/sessions/:id/line_items and to get the response?
this happens even on subscription even on single payment?
yes exactly
is it possible to install in mongodb function dependiec like stripe
const stripe = require('stripe')(skkey');
const lineItems = await stripe.checkout.sessions.listLineItems(
'cs_test_a1enSAC01IA3Ps2vL32mNoWKMCNmmfUGTeEeHXI5tLCvyFNGsdG2UNA7mr'
);
๐ What you can share safely
This is a public server. Anyone can see the messages posted here, so you need to be careful when sharing certain information.
๐ Not safe to share
Do not share anything sensitive or privileged on Discord, including the following:
- ๐ Secret API keys (most Stripe secret API keys start with
sk_,rk_, orek_) - ๐ Secrets (examples include Stripe's client secrets, which contain
_secret_, and Stripe's webhook signing secrets, which start withwhsec_) - ๐ Passwords, keys, or other login/authentication details
- ๐ Information about non-public features or functionality
If you don't want something public, don't share it here.
โ Safe to share
Stripe object IDs are safe to share in public, and are often required to help us investigate and debug issues. Some examples of IDs you can share safely are:
- โ
Customer IDs (
cus_) - โ
Checkout Session IDs (
cs_) - โ
Subscription IDs (
sub_) - โ
Invoice IDs (
in_) - โ
Setup Intent IDs (
seti_) - โ
Payment Intent IDs (
pi_) - โ
Charge IDs (
ch_andpy_) - โ
Request IDs (
req_)
This list isn't comprehensive; there are too many Stripe object IDs and prefixes to list that are safe to share publicly.
If in doubt, ask someone on this server with the Stripe Staff role if a particular piece of information is safe to share before you share it.
that is not my secret key but the example in documentation
this is your secret key
no
the docs uses your secret keys to give you an easy way to copy/paste and execute your code
how to change it now
just edit your message
it's a testmode secret key
you can roll it if you want but it's not a big deal
ok thank you
but let's go back to your ask
mongodb is just a database
you need to use a backend server (e.g. nodejs, java, etc...) to write your code with
but now for development we have managed everything in mongodb function
as they serve as backend
we install dependencies like in the doc https://www.mongodb.com/docs/atlas/app-services/functions/dependencies/ and stripe was accepted
mongodb doesn't execute HTTPS
ok you're talking about Mongo Atlas then
not mongodb
ok no prob
this https://www.mongodb.com/docs/atlas/app-services/functions/dependencies/#import-a-package-in-a-function describes how you import a package into your function after you add it to your dependencies
yes
and the rest is the same as any nodejs function
sure let me know if you need any more help