Closed suuunly closed 3 months ago
Hi @suuunly!
I would like to work on this issue,
For setting up a Test Stripe account, would you want me to add a step-by-step guide or an article link that demonstrates how to set up Test Stripe account
If we include the article link, populating the .env
file will be easy. Otherwise, we need to explain it in a readme file, But I think the readme
file will be lengthy.
There is an extension available in the VS Code marketplace for Stripe CLI
, which makes it easier for anyone to setup Stripe commands
Let me know what do you think?
@themujahidkhan by all means! ā¤ļø
Yes, I agree, that it would be better to link to their documentation about Setting up a Test Stripe Account;
Again, I agree, that linking to their documentation on populating the two .env
variables (public key and secret) is a good idea; perhaps we can link to a related section within a guide relating "Connecting Stripe to NextJS" to simplify the process?
Currently there is a script in the package.json
, called stripe:listen
, which will automatically start listening for callbacks from Stripe. When you run the command, it also automatically displays the final .env
key (the webhook related one) - that the user can plop right in to the .env
file. However, it does require the user to have the stripe cli installed. One danger about relying on vs code extensions, is that not everyone uses vs code, given the rise of new IDEs š³
stripe:listen
command is favoured, is because it also auto routes the callback to an endpoint within the app šstripe:listen
command as the 8th step in the run locally numeric guide:Hey @suuunly
Screenshot for the Setting up Stripe account
Screenshot for Running locally section
Looks good š The only changes I would suggest, are:
yarn stripe:listen
command in the project - this will reveal the webhook secret"yarn
instead of npm run
, and could be shortened to:
"Run yarn stripe:listen
in a separate terminal to listen for stripe changes"Looks good š The only changes I would suggest, are:
- Instead of going through the lengthy process of explaining how to get the webhook secret, you can say "run the
yarn stripe:listen
command in the project - this will reveal the webhook secret"- The final step in the Run locally section, should use
yarn
instead ofnpm run
, and could be shortened to: "Runyarn stripe:listen
in a separate terminal to listen for stripe changes"
Done the changes,
Screenshot for Stripe
Screenshot for Run locally
Oh, sorry for the confusion. I meant that when you run the yarn stripe:listen
command, it shows you your webhook key. Like so:
So in step 8 of your first screenshot, you can flip the two tasks. š Run the command, and theeen then fill out the WEBHOOK_SECRET
š
Also, just a minor thing, regarding your second screenshot, could you simplify the final line to just say yarn stripe:listen
, and maybe make it inline. It is mostly just to keep the format across the 8 steps consistent š
But other than that, it looks good š„³
oh one detail that is missing, is the prerequisite that you need to have the CLI installed on your machine š¤ You can make it a quick one liner saying install the Stripe CLI on your machine, and refer to this link: https://docs.stripe.com/stripe-cli
I've made changes as suggested,
Prerequisite
Setting up stripe account
Run Locally
That looks great. The absolute fiiiinal note would be to mention the WEBHOOK_SECRET
in the step 8, in the stripe account screenshot š
If that is done, then I'd say it is done š„³
yarn stripe:listen
in your terminal to retrieve the WEBHOOK_SECRET
value directly in the terminal.Would that work for you? Or need changes?
That is perfect! šš
Done, I've opened a PR
It has been approved and merged in š
Is your improvement request related to a specific problem in the code or project structure? Please describe. šØāš» Currently, it may be hard to run the application locally, as the application requires you to run a test stripe environment, with the added tunnel from your local machine to the stripe servers.
Additionally, there are 3
.env
variables that are not well documented, and might be difficult to understand at first glance.Describe the improvement or refactor you would like šÆ This should be in the
README
file. Containing the following:NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY
STRIPE_SECRET_KEY
WEBHOOK_SECRET
stripe:listen
command in the package.json a. By that I mean, installing the stripe cli for exampleAdditional context or comments Most of this can most likely be done by referencing Stripe's own documentation š¤