#anndonnelly

1 messages · Page 1 of 1 (latest)

dapper ironBOT
gray nymph
#

Hi there. Just catching up on the earlier thread!

cobalt yoke
gray nymph
#

Sorry for the delay!

#

I see you use an environment variable for your success URL

cobalt yoke
#

FRONTEND_URL=https://tekniverse-dev.teknikio.com

gray nymph
#

Got it, that makes sense. This matches what's happening in the video and what I see in your code: customers are being redirected to https://tekniverse-dev.teknikio.com/profile/settings; see line 3

cobalt yoke
#

Yes correct

#

I see in the documentation how to create the success url, i am just trying to couple this with the redirect to that page

#

I assume this is possible?

gray nymph
#

You can adjust the success URL to include the session ID

#

For example, if you adjust line 3 to:
...'/profile/settings?session_id={CHECKOUT_SESSION_ID}';

#

hold on, let me backtrack. redirecting users to /profile/settings means they will always be redirected to the settings page

#

If you want to display a success page with information about their payment, you should create a separate success page at https://tekniverse-dev.teknikio.com and adjust line 3 to something like ...'/success?session_id={CHECKOUT_SESSION_ID}';

cobalt yoke
#

I wasn't going to create a success page

gray nymph
#

got it, okay

cobalt yoke
#

potentially a modal based on tier change

#

I just want to redirect but need access to stripeSubscriptionId

gray nymph
#

got it

cobalt yoke
gray nymph
cobalt yoke
scarlet dome
#

👋 stepping in as roadrunner needed to step away

cobalt yoke
#

No problem

#

The other ids come from our env

scarlet dome
#

You won't have the Session ID ahead of creating the session. However, by appending {CHECKOUT_SESSION_ID} to the end of your Success URL, the session ID will be included on the actual redirect URL after the Session is completed

#

Your code looks good to see that Session as a URL param. Recommend trying it out