I want to test stripe webhooks in my local windows dev machine, stripe docs mention stripe CLI as the best /easier way to test webhooks endpoints and sending fake events, I followed the docs to down load stripe CLI into my windows machine, I extracted the executable into my desktop but now I don't know how to properly excute commands in my cmd.
stripe.exe in my desktop, I first tried just simply clicking it, command prompt opened and showed message bellow, after a few seconds the command prompt closes.
This is a command line tool.
You need to open cmd.exe and run it from there.
After that I tried opening a CMD window and drag and dropping stripe.exe into the tab, I get the following list of commands:
C:\Users\GABRIEL>C:\Users\GABRIEL\Desktop\stripe.exe
The official command-line tool to interact with Stripe.
Before using the CLI, you'll need to login:
$ stripe login
If you're working on multiple projects, you can run the login command with the
--project-name flag:
$ stripe login --project-name rocket-rides
Usage:
stripe [command]
Webhook commands:
listen Listen for webhook events
trigger Trigger test webhook events
Stripe commands:
logs Interact with Stripe API request logs
status Check the status of the Stripe API
Resource commands:
get Quickly retrieve resources from Stripe
charges Make requests (capture, create, list, etc) on charges
customers Make requests (create, delete, list, etc) on customers
payment_intents Make requests (cancel, capture, confirm, etc) on payment intents
... To see more resource commands, run `stripe resources help`
Other commands:
completion Generate bash and zsh completion scripts
config Manually change the config values for the CLI
feedback Provide us with feedback on the CLI
fixtures Run fixtures to populate your account with data
help Help about any command
login Login to your Stripe account
logout Logout of your Stripe account
open Quickly open Stripe pages
samples Sample integrations built by Stripe
serve Serve static files locally
version Get the version of the Stripe CLI
Flags:
--api-key string Your API key to use for the command
--color string turn on/off color output (on, off, auto)
--config string config file (default is
$HOME/.config/stripe/config.toml)
--device-name string device name
-h, --help help for stripe
--log-level string log level (debug, info, warn, error)
(default "info")
-p, --project-name string the project name to read from for config
(default "default")
-v, --version Get the version of the Stripe CLI
Use "stripe [command] --help" for more information about a command.
C:\Users\GABRIEL>
as you see I can't type any command, something like
stripe login
I'm left with no option to do anything with stripe cli in cmd.
To add the path of the stripe.exe file to your PATH environment variable on Windows, follow these steps:
Press the Windows key + R to open the Run dialog box.
Type "sysdm.cpl" in the Run dialog box and press Enter. This will open the System Properties window.
In the System Properties window, click on the "Advanced" tab.
Click on the "Environment Variables" button. This will open the Environment Variables window.
In the Environment Variables window, under the "System variables" section, scroll down and locate the "Path" variable. Select it and click on the "Edit" button.
In the Edit Environment Variable window, click on the "New" button to add a new entry.
Enter the full path to the directory where you have the stripe.exe file located. For example, if the stripe.exe file is in C:\Users\YourUsername\Desktop\the folder where stripe.exe is located, you would add 'C:\Users\YourUsername\Desktop\thefolderwherestripe.exeislocated' as a new entry.
Click "OK" to close all the windows.
Might not be needed but it is better to restart your computer
After restarting you should be able to access stripe cli globally, try stripe -v in cmd
#Please Note: a lot of people are adding the path like so
this is the wrong way: C:\Users\YourUsername\Desktop\foldername\stripe.exe
this is the correct way: C:\Users\YourUsername\Desktop\stripefolder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With