#.suryamani
1 messages Β· Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- .suryamani, 1 hour ago, 25 messages
- .suryamani, 18 hours ago, 62 messages
- .suryamani, 1 day ago, 23 messages
- .suryamani, 2 days ago, 43 messages
- .suryamani, 5 days ago, 19 messages
- .suryamani, 5 days ago, 10 messages
Hi, please elaborate here
How will i get seesionId in webhook events api code
Please be a lot more specific. What is your current code and which Id you are trying to retrieve?
This is my code
I need to get sessionID
cs_test_a1tSkKtp4snb9C3ZgtNGJmlo1wm3OkeVUy1zQmLFUfnnx5AXKHIh8s85jM
like this
@drowsy spear Are you there?
Hii
This is my code, I need to retrieve SessionId in Webhook How will i do that?
don't just repeat yourself, see #πrules 5 and be patient.
to answer the question β there's example code at https://stripe.com/docs/payments/checkout/fulfill-orders#handle-the-event that shows exactly what you're looking for.
i need SessionID
if you look at the code on that page it shows to create a variable called session and you'll notice a few lines later it calls session.Id, which is the ID you're looking for.
How will i use that id in my code?
var sessionId = session.Id;
// code that uses sessionID
// ....
var sessionObj = (Stripe.Checkout.Session)stripeEvent.Data.Object;
var session = sessionObj.Id;
is this format is correct?
I invite you to test the code yourself and find out.
I dont get value so only I'm asking this code is correct or not?
those two lines you shared are correct in isolation.
var sessionObj = (Stripe.Checkout.Session)stripeEvent.Data.Object;
My code doesn't cross this line while debugging
Maybe stripeEvent is not a checkout.session.completed event?
I need sessionid on begining
not sure what that means. But you can't do anything until you know what type of event you are receiving(that is why you wrote code with multiple if-statements that check the event type π ) and you can't access a CheckoutSession ID until you actually know it's a Checkout event you are handling.
The event is need to must CheckoutSessionCompleted event or anything else
sorry, I can't understand what you're saying("need to must" doesn't make sense to me).
When stripeEvent type is customer.subscription.deleted event then i will get session id or not?
You will not.
only on CheckoutSessionCompleted event type will i get sessionid I'm i right?
Yes.
Any other way to get sessionId?
not really.
why do you want it? It should only be relevant at the time you are handling a CheckoutSessionCompleted event and we shared documentation on how to handle that event.
I need SessionId to retrieve some values
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Could you please describe on the high-level what you're trying to achieve?
Are you with me?