#aki_code

1 messages ¡ Page 1 of 1 (latest)

inland solarBOT
#

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

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

foggy trellisBOT
umbral compass
#

Hello! Can you share the code you're using to set the success_url?

violet locust
#

yes

umbral compass
#

And, to clarify, is the session ID your own custom session ID generated on your end?

violet locust
#

have a method to build my checkout settings and a method to create the checkout session itself ( i do also save some data in my local db). AFTER these calls i modify the session object itself :

    // create the session options
    var sessionOptions = await _stripePaymentService.CreateSessionOptionsSubscription(stripeCustomerId, stripePriceId);

    var session = await _stripePaymentService.CreateCheckoutSessionSubscriptionAsync(sessionOptions, customerPrimaryKey, options.PriceId);

** //add session-id to redirect
session.CancelUrl += $"?sessionId={session.Id}";
session.SuccessUrl += $"?sessionId={session.Id}";
**
return Ok(session);
}

umbral compass
violet locust
#

the point is : only after creating the session with my "CreateCheckoutSessionSubscriptionAsync"-method . i cant add my session-id. also like i said. if i inspect the returning object "session" . i can see the correct url . i can copy paste it into my frontend and get a correct functionality. but the redirekt withing my stripe hosted checkout page not working

#

ah ok - so i do have to set the parameter in my options "CreateSessionOptionsSubscription" ?

umbral compass
#

Yeah, you need to set it when the Checkout Session is originally created.

#

There is no API to update a Checkout Session that already exists; you need to set everything to the way you want it at creation time.

violet locust
#

i have a method to build my options and a method to create the session with that given options. im testing it rn. i have set this parameter

#

YES . the redirect is working now i fix some code to grab the parameter

umbral compass
#

Nice!

violet locust
#

❤️ fast response fast help . u dont know how long i was looking for something hahah