#timothywu-help
1 messages · Page 1 of 1 (latest)
hello! can you elaborate more on what doesn't work?
- Which guide are you referring to? can you share the link?
- what were you expecting to happen? What happened instead?
- do you have a url which we can access to take a look?
I m using the guide to create a payment page on : https://stripe.com/docs/payments/quickstart
and on local when i run npm run dev it s working well
but when i build it and export with npm run build and build as : "build": "next build && next export", and i try to go to the checkout page it display nothing of stripe
is it because it s not supported on static like html ?
Are there any specific errors in the developer console?
Looks like your Next.js API Route for create-payment-intent is unreachable, which I guess is probably expected if you're using static exports: https://nextjs.org/docs/advanced-features/static-html-export#unsupported-features
thanks you very much for your quick response, i m new with next so i m not sure if i can do it but i ll give a try. But i don t understand how am i supposed to use getInitialProps
This is outside the realm of Stripe support really, but I'm quite familiar with Next.js so happy to help where I can
Why do you need to export to static HTML/JS?
Thank you very much ! i have to put my commerce on a server and i was told that the server will only work with static export
Yeah you're going to need a sever/host that can provide you with the functionality to run Node.js code (i.e. a API Route/serverless function) in order to create your Payment Intent
Why not host on Vercel? It's free and its the native host for Next.js apps (they created and maintain Next.js)
we have already a server so we are trying to using it, or else we have built it for nothing 😦
and is there a post or a tuto to make that ?
To make what?
a server that support nodejs code
I imagine you've written the code (in the create-payment-intent function in your Next.js app)
You just need a host to deploy that function to, and I wouldn't recommend building your own server for a single Node.js function
Use something like Heroku to deploy it
This would be so much easier for you if you just deployed it to Vercel