javascriptphpwindows

Using stripe CLI to test webhooks in windows dev machine


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.


Solution

  • You need to cd into the folder where you have stored stripe.exe. In your case that's:

    C:\Users\GABRIEL> cd Desktop
    

    Then you simply run stripe commands from there and it'll work. For instance:

    C:\Users\GABRIEL\Desktop> stripe --help
    

    OR

    C:\Users\GABRIEL\Desktop> stripe login