i have tried a lot of different ways and i can't seem to get adequation documentation on this
I am try to to fetch this URL /api/stripe/${sessionId}
to the server-side API path that looks like this
api/stripe/[session]/route.js
and retrieve the sessionId to make a stripe call
import Stripe from "stripe";
const stripe = new Stripe(process.env.STRIPE_SECRETE_KEY);
export async function GET(req){
const {sessionId} = NextRequest.nextUrl.searchParams
console.log(sessionId)
const checkoutSession = await stripe.checkout.sessions.retrieve(sessionId,
)
return NextResponse.json({checkoutSession})
}```