#waleed-nextjs-checkoutredirect

1 messages · Page 1 of 1 (latest)

golden craterBOT
wild nest
#

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.

buoyant meadow
#

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?

wild nest
#

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
buoyant meadow
#

yes and the status 200 on stripe dashboard

#

the cdoe snaps might help you now what i am trying to do1

wild nest
#

It sounds like your Nextjs router is intercepting the the redirect and trying to perform it within your Nextjs application.

buoyant meadow
#

have you reviewed my code? and you verify that there is nothing wrong there? and if yes then how i can solve this problem?

wild nest
#

You need to review your code. You should be making a full browser redirect with the Chekcout Session URL. Are you doing that?

buoyant meadow
#

i think this ``` return NextResponse.json({ session: checkoutSession }, { status: 200 });

wild nest
#
  1. I am not an expert in Next, you will need to be sure of this
  2. That is returning the full Checkout object, what are you doing with it after that?
golden craterBOT
#

waleed-nextjs-checkoutredirect