#aki_code
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/1222240903188713602
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! Can you share the code you're using to set the success_url?
yes
And, to clarify, is the session ID your own custom session ID generated on your end?
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);
}
You can't modify those URLs after the Checkout Session is created. You should use the {CHECKOUT_SESSION_ID} placeholder instead: https://docs.stripe.com/payments/checkout/custom-success-page#modify-the-success-url
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" ?
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.
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
Nice!
â¤ď¸ fast response fast help . u dont know how long i was looking for something hahah