#waleed-nextjs-checkoutredirect
1 messages · Page 1 of 1 (latest)
Hi 👋
I can't really follow what your application is doing here based on screenshots.
Can you describe, step by step, what your application is trying to do and clealy point ot where the error is occuring in your flow.
If you need to share code try to keep it short and specific and share it as text between three ` marks.
sure i am sorry for not posting my question properly before. what i am trying to do is create a subscription using stripe. and for that i have created code. My application is creating the stripe customer when the user is registered and then using that customerId that stripe created at time of customerCreation i am passing to the checkoutSession function. now when i select a subscription it is taking me to the stripe checkout page but throwing an error " Something went wrong
You might be having a network connection problem, the link might be expired, or the payment provider cannot be reached at the moment." and when i checked the stripe logs its status 200 so it means there is something wrong with my side?
I'm going to try to summarize in steps and you let me know if I get this right
- Customer created when user registers on site
- Checkout Session created with Customer ID
- Redirect to Checkout Session URL <- THis is where you hit the error page
yes and the status 200 on stripe dashboard
the cdoe snaps might help you now what i am trying to do1
It sounds like your Nextjs router is intercepting the the redirect and trying to perform it within your Nextjs application.
have you reviewed my code? and you verify that there is nothing wrong there? and if yes then how i can solve this problem?
You need to review your code. You should be making a full browser redirect with the Chekcout Session URL. Are you doing that?
i think this ``` return NextResponse.json({ session: checkoutSession }, { status: 200 });
- I am not an expert in Next, you will need to be sure of this
- That is returning the full Checkout object, what are you doing with it after that?
waleed-nextjs-checkoutredirect