You can check a live sample in CodeSandbox. To test the complete flow you need to open the browser in a new tab.
Create an .env file with STRIPE_SECRET and STRIPE_CLIENT as well as a .env.build file with STRIPE_CLIENT and any other variable that Next needs at build time.
Add CodeSandbox secrets for STRIPE_SECRET and STRIPE_CLIENT.
Keep the now.json file and add the environment variables with the NOW CLI
now secrets add <secret-name> <secret-value>.