#karnthis
1 messages ยท Page 1 of 1 (latest)
Can you quote your full code around the place?
s, _ := session.Get(
"cs_test_xxx",
nil,
)
is our example code from https://stripe.com/docs/api/checkout/sessions/retrieve?lang=go
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
sure thing. this is the full function: ```go
func(w http.ResponseWriter, req bunrouter.Request) error {
id := req.Param("id")
if len(id) == 0 {
warning := "Failed to get Session ID"
return jutils.ProcessCustomHttpError("checkoutSession", warning, 404, w)
}
sessionID := req.URL.Query().Get("sessionId")
sesh, err := session.Get(sessionID, nil)
utils.WriteJSON(w, sesh, err)
return nil
}
the critical logic was pulled directly from the docs. if it is helpful, the sessionId I am getting every time is `xyz`. I am assuming that is because I am in test mode?
Like exactly xyz? That's not a valid value for checkout session id
it should be cs_test_xxx
That's weird
lol glad it isn't just me then
I think the issue is the statge before
sure let me grab that code
why do you receive session_id=xyz all the time
I have no idea ๐
oh....... oh wow I am an idiot
so sorry to have wasted your time, I just noticed I have a little block tucked awayt that hard codes the session_id
I have no idea why I do, but I do
no worries, glad that you managed to figure things out
thanks so much for your attention
@vale comet reopened!
thanks so much! just a note, it was not clear to me that the ``session_id={CHECKOUT_SESSION_ID}` in the docs is NOT an example value but a literal that the stripe package replaces directly
this whole time I was operating under the impression I needed to capture and include that data myself
ah i see, i'll pass on that feedback!
it could simply be my lack of experience with stripe