Giter Site home page Giter Site logo

stripe-cli's People

Contributors

aarongreen-stripe avatar auchenberg-stripe avatar bernerd-stripe avatar charliecruzan-stripe avatar ctrudeau-stripe avatar dbalatero-stripe avatar dependabot[bot] avatar etsai-stripe avatar gracegoo-stripe avatar ianjabour-stripe avatar jmuia-stripe avatar joek-stripe avatar joyluu-stripe avatar kwu-stripe avatar lemuel-stripe avatar mimi-stripe avatar ob-stripe avatar pepin-stripe avatar polybuildr avatar remi-stripe avatar richardm-stripe avatar stephchen-stripe avatar stripe-openapi[bot] avatar suz-stripe avatar thorsten-stripe avatar tlefevre-stripe avatar tomelm avatar tomer-stripe avatar vcheung-stripe avatar xavdid-stripe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stripe-cli's Issues

stripe cli login stuck on "Waiting for confirmation"

Issue

stripe login --api-key pk_test_****
it then shows
Your pairing code is: some-codes
This pairing code verifies your authentication with Stripe.
Press Enter to open the browser (^C to quit)
⣯ Waiting for confirmation...
Then it sticks in it and after some mins it shows
exceeded max attempts and quits

Expected Behavior

Probably opens a browser. Not sure.

Environment

Ubuntu 19 Linux

listen fails when run non-interactively

Issue

I am trying to run stripe listen non-interactively in one docker container to proxy events to a different docker container, so that I can validate my webhooks in an automated test.

I run:

stripe listen --device-name my-test --api-key sk_test_XXXX

The output is:

your device name has not been configured. Use `stripe configure` to set your device name

but if I then run:

stripe configure

it outputs:

unknown command "configure" for "stripe"

So, the issue is:

  1. I don't know what a device is, but according to stripe listen --help I should be able to set this with --device-name. The first command should succeed as is.
  2. The error output should not refer to a nonexistent command.

If I populate ~/.config/stripe/config.toml directly instead of using command-line flags, stripe listen works great. (While undocumented, this might be a better idea regardless, because then I don't need to worry about my API key being in an error message if the command fails.)

Environment

Ubuntu 18.04 running under Docker, Stripe CLI 0.2.3 installed via https://github.com/stripe/stripe-cli/releases/download/v0.2.3/stripe_0.2.3_linux_amd64.deb.

Postscript

stripe listen is great. I've been wanting something like this for a long time.

doesnt seem to listen to more than one event?

The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

Issue

When I try to do two actions on stripe (Cancel subscription and Reactivate it) - it feels like it only listens to ONE event?
Screenshot 2019-10-06 at 9 29 25 AM

Expected Behavior

I expect the second action to also generate a console line indicating it has recieved an event?

Steps to reproduce

Start up the cli stripe listen --forward-to https://localhost/stripe/webhook
Go to your stripe dashboard -
Create a subscription Product and create it for a dummy customer if there isnt one to play around with
Go to that customer and try to cancel the subscription.
You will see one output:
2019-10-06 09:26:29 Received:

But now when you try to reactivate it. You will not see any output.

Also note that quitting* and restarting and then if you reactivate you see an acknowledge message like above but if you do a second action it again doesnt acknowledge it

*which in itself is broken - i try to do control +C, it doesnt seem to work, so i end up doing ctrl +c, x, z and command +c,z,x etc

I am also not sure if when it fwds the request it uses a GET or a POST? as even the one event it acknowledges my App doesnt seem to be responding?

Environment

macOS

Support of "payment_intent.canceled" event

Problem

payment_intent.canceled event is not supported at the moment

Feature

Support of payment_intent.canceled.

Examples

Running stripe trigger payment_intent.canceled leads to event payment_intent.canceled is not supported.

Pull request #229

stripe listen posts to incorrect url

Issue

Starting up listen locally works and I can see the webhooks getting sent:

stripe listen --load-from-webhooks-api --forward-to localhost:3000/_billing_events --forward-connect-to localhost:3000/_billing_event

However, Stripe posts to / of my Rails app no matter what.

Expected Behavior

Receive a POST at /_billing_events on port 3000

Steps to reproduce

Described in the above

Traceback

[Sun, 08 Sep 2019 21:11:12 PDT]  INFO Received Connect event: evt_1FGeDcLlccjANAyCK4MbPG7P [type: invoice.payment_succeeded]
[Sun, 08 Sep 2019 21:11:12 PDT]  INFO Received Connect event: evt_1FGeDcLlccjANAyCvYeiN11P [type: customer.subscription.created]
[Sun, 08 Sep 2019 21:11:12 PDT]  INFO Got response from local endpoint, status=404
[Sun, 08 Sep 2019 21:11:12 PDT]  INFO Got response from local endpoint, status=404

Environment

macOS

ERROR read error: websocket: unexpected reserved bits 0x40

Issue

When listening to webhooks, there's occasional error messages

Expected Behavior

Expect to only see messages related to webhook events

Steps to reproduce

$ stripe listen

Traceback

ERROR read error: websocket: unexpected reserved bits 0x40

Environment

macOS 10.14.6

Installation in a firewalled Ubuntu VM throws error: "gpg: keyserver receive failed: Server indicated a failure"

Issue

I am using Laravel Homestead, an Ubuntu-based development VM — which I would assume many people would want to use with stripe-cli, given the popularity of Laravel Cashier.

But trying to install stripe-cli by following the installation instructions for Debian and Ubuntu-based distributions fails at step 1 when run inside a firewalled VM.

The docs instruct to run the following command to add Bintray's GPG key to the apt sources keyring:

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-keys 379CE192D401AB61

However, when running the commands from within a firewalled virtual machine, this may result in the following vague error:

Executing: /tmp/apt-key-gpghome.mA57CDqXT9/gpg.1.sh --keyserver hkp://pool.sks-keyservers.net --recv-keys 379CE192D401AB61
gpg: keyserver receive failed: Server indicated a failure

Solution

Specifying that port 80 should be used for the keyserver URL seemed to allow the command to run successfully for me:

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 379CE192D401AB61

It may be worth updating the installation docs to account for this.

Listen stops silently after computer goes to sleep

Issue

I am using stripe listen --forward-to (amazing feature 🙇) on my mac. It is running in the foreground in one terminal tab.
When I leave my computer for some time (goes to sleep) and I come back, the command is still running but no new webhooks are received and forwarded

Expected Behavior

I would expect the CLI to either quit when not connected, or (better) reconnect automatically

Steps to reproduce

Run stripe listen --forward-to, but the computer to sleep for a while, come back, trigger a webhook and see it delivered

Environment

macOS, installed using brew

trigger payment_intent.created with listen --forward-to local sends 3 POST requests

Issue

Apologies if this is a me issue, and not a bug, but I am having the following problem:

I am testing a rails endpoint set up to accept the payment_intent.succeeded webhook, and when triggering the event I am seeing 3 subsequent POST requests to my local server.

My webook is set up from the dashboard to only notify on payment_intent success/failure.

Expected Behavior

I expect there to be 1 POST request (for the payment intent success) rather than 3.

Steps to reproduce

  • I have my local server running and am listening with stripe listen --forward-to <local server>.
  • When I trigger a payment_intent.succeeded, I invariably see 3 separate POST requests to my server.

Traceback

From cli trigger window:

> stripe trigger payment_intent.succeeded
Trigger succeeded! Check dashboard for event details.

From stripe listen window:

stripe listen --forward-to localhost:3000/services/stripe/payment_intents
> Ready! Your webhook signing secret is <SECRET> (^C to quit)
2019-10-01 13:37:26  Received: payment_intent.created [evt_1FOs6EEeqVASFOA53jddw7Q8]
2019-10-01 13:37:26  Received: charge.succeeded [evt_1FOs6EEeqVASFOA56kApBNZN]
2019-10-01 13:37:26  Received: payment_intent.succeeded [evt_1FOs6FEeqVASFOA5veXZwo3O]
2019-10-01 13:37:26            [200] POST http://localhost:3000/services/stripe/payment_intents
2019-10-01 13:37:26            [200] POST http://localhost:3000/services/stripe/payment_intents
2019-10-01 13:37:26            [200] POST http://localhost:3000/services/stripe/payment_intents

From my local server window:

Started POST "/services/stripe/payment_intents" for ::1 at 2019-10-01 13:37:26 -0700
Processing by....
X 3

It seems like the trigger is not recognizing the webhook settings in the UI and sending all downstream events anyway?

Environment

macOS

Authenticating and then listening fails with 500

Hi,

This is great! I literally requested this in a Stripe engineering session and here it is. Thank you! I literally paid for ngrok today, and then this. Magic!!

I installed the cli via homebrew as instructed on macOS (Mojave)

Running stripe login works great ... browser opens and I get an authenticated message.

$ stripe login
Your pairing code is: nifty-reform-solid-excite
Press Enter to open up the browser (^C to quit)
> Done! The Stripe CLI is configured for Tito with account id user_...

but when I run stripe listen, I just get a 500 every time:

$ stripe listen --forward-to https://checkout.dev.tito.io/incoming_webhooks
⣽ Getting ready... [Tue, 16 Jul 2019 23:22:58 IST] FATAL Error while authenticating with Stripe: Authorization failed, status=500, body={
  "error": {
    "message": "An unknown error occurred",
    "type": "api_error"
  }
}

Not much more I can do from here!

No such host

I am receiving events but also receive errors when trying to reach the local app. Setup is Laravel 5.7 with Homebrew and Valet.

Ready! Your webhook signing secret is whsec...
[Sun, 21 Jul 2019 13:52:21 CEST] INFO Received event: evt_1EydaSJFP015mQcJpyAozhkF [type: payment_intent.created]
[Sun, 21 Jul 2019 13:52:21 CEST] ERROR Failed to POST event to local endpoint, error = Post https://myappname.test/hooks/stripe/paymentintent: dial tcp: lookup friendships.test on MYIP:53: no such host

Password needed to run Stripe CLI ?

$ docker run --rm -it stripe/stripe-cli version
Unable to find image 'stripe/stripe-cli:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/stripe/stripe-cli/manifests/latest: unauthorized: incorrect username or password.
See 'docker run --help'.

Why do I need a password to fetch the Stripe CLI image? What kind of password do I need? Can you add some instructions around this to the readme? Thanks.

AVG AntiVirus flags the CLI as suspicious

Reported by @homemadePopcorn in #37:

stripe.exe was labelled as a suspicious file by my anti-virus software. I can add an exception to that file on my firewall but just thought I would write the issue down.

Is there something we can do to make Windows happier with that behavior? We didn't have issues with this when we were doing Windows testing locally, wonder if there's something specific it's flagging.

Stripe open throws exception

Stripe open throws exception.

Screen Shot 2019-08-28 at 1 53 48 PM

Steps:

  1. Install CLI
  2. Run stripe open

Actual

stripe open
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/stripe/stripe-cli/pkg/cmd.(*openCmd).runOpenCmd(0xc0000940d0, 0xc0001b2780, 0x19e9fd8, 0x0, 0x0, 0x0, 0x0)
        /home/travis/gopath/src/github.com/stripe/stripe-cli/pkg/cmd/open.go:121 +0x4be
github.com/spf13/cobra.(*Command).execute(0xc0001b2780, 0x19e9fd8, 0x0, 0x0, 0xc0001b2780, 0x19e9fd8)
        /home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:826 +0x465
github.com/spf13/cobra.(*Command).ExecuteC(0x19c4da0, 0x6bd, 0xc0000c5f68, 0x147e2f8)
        /home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:914 +0x2fc
github.com/spf13/cobra.(*Command).Execute(...)
        /home/travis/gopath/pkg/mod/github.com/spf13/[email protected]/command.go:864
github.com/stripe/stripe-cli/pkg/cmd.Execute()
        /home/travis/gopath/src/github.com/stripe/stripe-cli/pkg/cmd/root.go:59 +0x9e
main.main()
        /home/travis/gopath/src/github.com/stripe/stripe-cli/cmd/stripe/main.go:6 +0x20

Expected

No error and list of available open commands.

Creating issuing_authorization.* events

Problem

I'd like to use stripe-cli to help me with end to end testing of issuing webhooks.

I'd like to be able to trigger issuing events:

  • issuing_authorization.request
  • issuing_authorization.created
  • issuing_authorization.updated

Feature

I'd like to be able to trigger hooks on a connected account so I can test different use cases like:

  • approving/declining authorizations
  • reversed authorization in USD and non-USD currency
  • updated authorization when a business reduces the amount of funds requested
  • authorizations that are not USD

I'm not sure if this is the right way to approach it, any help is appreciated.

I was thinking of creating a new authorization but the API doesn't have an endpoint to do so
https://stripe.com/docs/api/issuing/authorizations

I guess a simple test case would be:

  1. create a new authorization
  2. issuing_authorization.request event gets triggered
  3. event is forwarded using stripe-cli to a local instance
  4. authorization gets approved and I do check my expectations

Thanks!

Examples

➜  stripe trigger issuing_authorization.updated
event issuing_authorization.updated is not supported.

Just an example to show cli is setup correctly

➜  stripe get /issuing/cardholders --stripe-account acct_***
{
  "object": "list",
  "data": [

  ],
  "has_more": false,
  "url": "/v1/issuing/cardholders"
}
➜  stripe trigger payment_intent.created
Trigger succeeded! Check dashboard for event details.

get --expand doesn't work properly

-d 'expand[]=foo' works to expand fields in API responses but --expand foo (as per documentation) gives the following error:

{
  "error": {
    "message": "Invalid array",
    "param": "expand",
    "type": "invalid_request_error"
  }
}

Tried with:

> stripe get subscriptions/sub_FSBap8m2DfyHl8 --expand latest_invoice
> stripe get subscriptions/sub_FSBap8m2DfyHl8 -d 'expand[]=latest_invoice'

Environment

macOS 10.14.5, stripe CLI installed via homebrew

> stripe --version
stripe version 0.2.2

charge.refunded webhook support

Problem

Trying to test charge.refunded webhooks with the CLI but it is not supported as of now.

Feature

Support for charge.refunded events in the CLI. Providing a way to specify the charge_id you want it to attach to, and a refund amount to test it with would be amazing.

WARN Received malformed message: Unexpected message type: error

The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

Issue

While testing my application, I use stripe CLI to forwardd webhook events to my local dev server. Everything seems to be working well except I get the following warning for every webhook event that arrives.

WARN Received malformed message: Unexpected message type: error

Expected Behavior

I expected to not receive warnings or maybe a more descriptive warning message.

Steps to reproduce

Starting with a dev server running locally at port 8000, Issue the following command

./stripe listen --forward-to localhost:8000/stripe/webhook/

Traceback

> Ready! Your webhook signing secret is whsec_***** (^C to quit)
2019-10-03 14:15:34  Received: customer.created [evt_1FPYpuC4YIU961kJvzVQYypN]
2019-10-03 14:15:34            [200] POST http://localhost:8000/stripe/webhook/
[Thu, 03 Oct 2019 14:15:34 EDT]  WARN Received malformed message: Unexpected message type: error
2019-10-03 14:15:50  Received: customer.updated [evt_1FPYqAC4YIU961kJpBIi9Pd3]
2019-10-03 14:15:50  Received: payment_method.attached [evt_1FPYqAC4YIU961kJD1w1xprf]
2019-10-03 14:15:50  Received: customer.source.created [evt_1FPYqAC4YIU961kJv9rEpjFY]
2019-10-03 14:15:50            [200] POST http://localhost:8000/stripe/webhook/
2019-10-03 14:15:51            [200] POST http://localhost:8000/stripe/webhook/
[Thu, 03 Oct 2019 14:15:52 EDT]  WARN Received malformed message: Unexpected message type: error
[Thu, 03 Oct 2019 14:15:52 EDT]  WARN Received malformed message: Unexpected message type: error
2019-10-03 14:15:52  Received: charge.succeeded [evt_1FPYqCC4YIU961kJjgpQMtEn]
2019-10-03 14:15:53  Received: payment_intent.created [evt_1FPYqCC4YIU961kJxZP6jR0R]
2019-10-03 14:15:53  Received: payment_intent.succeeded [evt_1FPYqCC4YIU961kJXJFaJ1LJ]
2019-10-03 14:15:53            [200] POST http://localhost:8000/stripe/webhook/
2019-10-03 14:15:53  Received: customer.updated [evt_1FPYqDC4YIU961kJ0gauIXjj]
[Thu, 03 Oct 2019 14:15:53 EDT]  WARN Received malformed message: Unexpected message type: error
2019-10-03 14:15:53            [200] POST http://localhost:8000/stripe/webhook/
2019-10-03 14:15:53  Received: invoice.created [evt_1FPYqDC4YIU961kJhJDPfa6N]
[Thu, 03 Oct 2019 14:15:53 EDT]  WARN Received malformed message: Unexpected message type: error
2019-10-03 14:15:53  Received: invoice.finalized [evt_1FPYqDC4YIU961kJxl6e3gqF]
2019-10-03 14:15:53            [200] POST http://localhost:8000/stripe/webhook/
2019-10-03 14:15:53            [200] POST http://localhost:8000/stripe/webhook/
2019-10-03 14:15:53  Received: invoice.payment_succeeded [evt_1FPYqDC4YIU961kJW6NPf0p3]
[Thu, 03 Oct 2019 14:15:53 EDT]  WARN Received malformed message: Unexpected message type: error
[Thu, 03 Oct 2019 14:15:53 EDT]  WARN Received malformed message: Unexpected message type: error
2019-10-03 14:15:53  Received: customer.subscription.created [evt_1FPYqDC4YIU961kJJZNWZVue]
2019-10-03 14:15:54            [200] POST http://localhost:8000/stripe/webhook/
[Thu, 03 Oct 2019 14:15:54 EDT]  WARN Received malformed message: Unexpected message type: error
2019-10-03 14:15:54            [200] POST http://localhost:8000/stripe/webhook/
[Thu, 03 Oct 2019 14:15:54 EDT]  WARN Received malformed message: Unexpected message type: error
2019-10-03 14:15:55            [200] POST http://localhost:8000/stripe/webhook/
2019-10-03 14:15:55            [200] POST http://localhost:8000/stripe/webhook/
2019-10-03 14:15:55            [200] POST http://localhost:8000/stripe/webhook/
[Thu, 03 Oct 2019 14:15:55 EDT]  WARN Received malformed message: Unexpected message type: error
[Thu, 03 Oct 2019 14:15:55 EDT]  WARN Received malformed message: Unexpected message type: error
[Thu, 03 Oct 2019 14:15:55 EDT]  WARN Received malformed message: Unexpected message type: error

Environment

Linux (Fedora 30)

WebSocket frame length too large

Just set this up to use instead of https://ngrok.io for webhook testing.

It seems that, at least for me, the webhooks functionality is not entirely reliable.

[Wed, 17 Jul 2019 12:46:59 EEST]  INFO Received event: evt_1Ex9iwFSbr6xR4YALCCcvkG6 [type: charge.failed]
[Wed, 17 Jul 2019 12:46:59 EEST]  INFO Received event: evt_1Ex9iwFSbr6xR4YAzXlJL5BA [type: source.chargeable]
[Wed, 17 Jul 2019 12:46:59 EEST]  INFO Received event: evt_1Ex9iwFSbr6xR4YALCCcvkG6 [type: charge.failed]
[Wed, 17 Jul 2019 12:46:59 EEST]  INFO Received event: evt_1Ex9iwFSbr6xR4YALCCcvkG6 [type: charge.failed]
[Wed, 17 Jul 2019 12:47:00 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:47:01 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:47:01 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:47:01 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:47:01 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:47:01 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:47:02 EEST] ERROR read error: websocket: close 1009 (message too big): WebSocket frame length too large
[Wed, 17 Jul 2019 12:47:02 EEST] ERROR read error: websocket: close 1009 (message too big): WebSocket frame length too large
[Wed, 17 Jul 2019 12:47:03 EEST] ERROR read error: websocket: close 1009 (message too big): WebSocket frame length too large
[Wed, 17 Jul 2019 12:52:51 EEST]  INFO Received event: evt_1Ex9ocFSbr6xR4YAMbMYmUW5 [type: source.chargeable]
[Wed, 17 Jul 2019 12:52:51 EEST]  INFO Received event: evt_1Ex9ocFSbr6xR4YAMbMYmUW5 [type: source.chargeable]
[Wed, 17 Jul 2019 12:52:51 EEST]  INFO Received event: evt_1Ex9ocFSbr6xR4YAMbMYmUW5 [type: source.chargeable]
[Wed, 17 Jul 2019 12:52:52 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:52:52 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:52:52 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:52:53 EEST] ERROR read error: websocket: close 1009 (message too big): WebSocket frame length too large
[Wed, 17 Jul 2019 12:52:53 EEST] ERROR read error: websocket: close 1009 (message too big): WebSocket frame length too large
[Wed, 17 Jul 2019 12:52:54 EEST] ERROR read error: read tcp 192.168.1.6:52461->54.187.159.182:443: i/o timeout
[Wed, 17 Jul 2019 12:55:51 EEST]  INFO Received event: evt_1Ex9rXFSbr6xR4YAehMY6wdv [type: source.chargeable]
[Wed, 17 Jul 2019 12:55:51 EEST]  INFO Received event: evt_1Ex9rXFSbr6xR4YAehMY6wdv [type: source.chargeable]
[Wed, 17 Jul 2019 12:55:51 EEST]  INFO Received event: evt_1Ex9rXFSbr6xR4YAehMY6wdv [type: source.chargeable]
[Wed, 17 Jul 2019 12:55:52 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:55:52 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:55:52 EEST]  INFO Got response from local endpoint, status=400
[Wed, 17 Jul 2019 12:55:53 EEST] ERROR read error: websocket: close 1009 (message too big): WebSocket frame length too large
[Wed, 17 Jul 2019 12:55:53 EEST] ERROR read error: websocket: close 1009 (message too big): WebSocket frame length too large
[Wed, 17 Jul 2019 12:57:04 EEST] ERROR read error: read tcp 192.168.1.6:52729->54.187.119.242:443: i/o timeout

Is there a debug mode or something I could enable to provide more information than this? The webhooks in question are triggered using Charge API with card number 4000000000003063 to trigger 3DS 1.0 flow.

Allow fetching production mode logs

It would be nice if there was a way to fetch error logs from production, using filters that aren't available via the dashboard https://dashboard.stripe.com/logs

e.g. I'd like to see a list of the latest HTTP 400 invalid_request_error logs, with HTTP 402 card_error logs filtered out in a format that I can pipe through jq to extract more info.

Ideally these filters would be available in the dashboard too, but I can't see a way to do that.

Add new command to open dashboard

Problem

I'm a developer that's authenticated as a particular user/org in the CLI, and I want to quickly be able to open the Stripe Dashboard without changing user and using the org-switcher

Feature

Add new stripe dashboard command that would open the default browser, navigating to Stripe Dashboard authenticated as that particular user/org.

This feature could be generalized to other areas with a generic stripe open <x> command.

Areas of interest:

  • stripe open dashboard
  • stripe open dashboard/<area>
  • stripe open dashboard/terminal
  • stripe open docs
  • stripe open docs/search/<keyword>

`stripe login` failed right after installation

stripe version 0.6.5 (beta)

Issue

Ran stripe login and received error message

Post https://dashboard.stripe.com/stripecli/auth: http2: server sent GOAWAY and closed the connection; LastStreamID=1, ErrCode=ENHANCE_YOUR_CALM, debug=""

Expected Behavior

According to the readme: "You'll be redirected to the Stripe dashboard to confirm that you want to give access to your account to the CLI. After confirming, a new API key will be created and returned to the CLI."

Steps to reproduce

brew install stripe/stripe-cli/stripe
stripe login

Traceback

Post https://dashboard.stripe.com/stripecli/auth: http2: server sent GOAWAY and closed the connection; LastStreamID=1, ErrCode=ENHANCE_YOUR_CALM, debug=""

Environment

macOS

Allow forwarding to endpoints with a self signed certificate

Problem

We use a self signed SSL certificate for our API when developing locally. When trying to forward requests to an endpoint on that API we get an error because the SSL certificate is not valid.

Feature

It would be useful to have a flag that allows ignoring the certificate check. I suspect a lot of other developers use a similar setup.

Examples

ERROR Failed to POST event to local endpoint, error = Post https://api.local/stripe: x509: certificate signed by unknown authority

716754

The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

Issue

Describe what happened and what you were trying to do

Expected Behavior

Tell us what you expected to happen

Steps to reproduce

What are the steps we can take to reproduce this and verify it's fixed?

Traceback

Share any debug output that was given by the CLI

Environment

Select one of: macOS, Linux, Windows, Other

`--api-version` not working

stripe listen --api-version 2019-09-09 results in:

unknown flag: --api-version

The same goes for stripe trigger checkout.session.completed --api-version 2019-09-09

Second issue:
It looks like Stripe CLI is defaulting to the 2019-03-14 API version, not to my currently used API version.

I have:

stripe version 0.6.12 (beta)

stripe -v Support

I think it'd be awesome to see a shortcut to run stripe -v and have the same behavior as stripe --version.

stripe-cli login doesn't work on docker + linux

$ docker run --rm -it stripe/stripe-cli login
Your pairing code is: virtue-vivid-jovial-rosy
Press Enter to open up the browser (^C to quit)
⣾ Waiting for confirmation... exec: "xdg-open": executable file not found in $PATH
$ echo $XDG_CONFIG_HOME

$ which xdg-open
/usr/bin/xdg-open

Is it trying to run xdg-open inside the container? Can it maybe print the URL I'm supposed to open?

Add support for listening to only certain events

It'd be nice to be able to listen for certain events only. Currently It sends listens for all events. Something like this:

stripe listen --events checkout.session.completed customer.created

Stripe doesn't stop listening after quitting

After quitting stripe CLI using ^C, it still remains in the process list, listening and polluting output on receiving webhook. (This also explains the duplicate lines in the output of #38)

~: stripe listen --forward-to http://<REDACTED>
[1] 14685
 ~: > Ready! Your webhook signing secret is whsec_<REDACTED> (^C to quit)
[^C]
 ~: ps
  PID TTY           TIME CMD
<REDACTED>
14685 ttys001    0:00.15 stripe listen --forward-to <REDACTED>
 ~:

Trigger request

Problem

What are you trying to do?

I'm trying to test a webhook endpoint's event handlers. The plugin I'm updating to the latest API has only a few of them, but just one is supported in the current CLI:

  • invoice.payment_succeeded

Feature

What would help you accomplish your original task

I was wondering if you are planning to add any of these soon?

  • invoice.payment_failed
  • customer.deleted
  • customer.subscription.deleted
  • charge.refunded
  • charge.dispute.created

Or is there any way for the "Send Test Webhook" tool in the dashboard, to use actual objects from previous tests or made-up ones, that the handler could then retrieve or update?

Thanks for all your work! :)

Listen output can be a bit confusing when receiving multiple events

Hey! Fantastic work on the cli, makes testing webhooks so much easier 😄.

When dealing with multiple webhook calls from Stripe in a short period of time, the cli output can be a bit confusing, see screenshot below:
Capture d’écran 2019-10-03 à 14 32 58

Understanding which webhook failed and which succeeded can be hard when new Received message are inserted between response status. Would it be possible to log which event id the request are related to? For example:

2019-10-03 14:29:43  Received: invoice.created [evt_1FPZ3bKhzQLuvV5m9skPC8Hs]
2019-10-03 14:29:43  Received: customer.subscription.created [evt_1FPZ3bKhzQLuvV5mxfEgQ0B3]
2019-10-03 14:29:43  Received: invoice.finalized [evt_1FPZ3bKhzQLuvV5mYJi4b0qz]
2019-10-03 14:29:44            [200] POST http://stripe.lvh.me:3001/api/stripe_event [evt_1FPZ3bKhzQLuvV5m9skPC8Hs]
2019-10-03 14:29:44            [200] POST http://stripe.lvh.me:3001/api/stripe_event [evt_1FPZ3bKhzQLuvV5mxfEgQ0B3]
2019-10-03 14:29:44            [500] POST http://stripe.lvh.me:3001/api/stripe_event [evt_1FPZ3bKhzQLuvV5mYJi4b0qz]

I'm using version 0.6.12 (beta) on MacOS 10.13.6

Add separate forwards for account and connect hooks

Problem

In our staging and production setup, as well as current use with ngrok, we have two separate URLs set up - one for account hooks on our platform account and one for connect events for all connected accounts. However, the CLI only supports a single forward-to.

Feature

Add a separate URL / forward-to-connect argument to split the two types of events.

stripe get doesn't support --project-name

The command only works when there's a [default] project. Using --project-name to choose a project produces this:

API key is too short, must be at least 12 characters long

API key configuration fails

Issue

Trying to set up and run https://github.com/stripe/stripe-payments-demo but the start script fails at the step that runs stripe listen. It seems that stripe thinks the API keys are not set, but AFAICT they are.

Edit: the stripe command appears to work if I specify --api-key rk_test_#### from the default section of the config file. So it seems that stripe is not propagating the default api key for a non-default project (or device?) name. /edit

To verify, I manually ran the stripe listen command:

$ stripe listen --project-name=stripe-payments-demo --forward-to http://localhost:8000/webhook
you have not configured API keys yet. To do so, run `stripe login` which will configure your API keys from Stripe

So I ran stripe login:

$ stripe login
Your pairing code is: ####-####-####-####
This pairing code verifies your authentication with Stripe.
Press Enter to open the browser (^C to quit)
Done! The Stripe CLI is configured for your account with account id ####

But after running stripe login and clicking the button to verify in the web browser that opens, stripe listen makes the same error.

According to stripe --help, the default config file is $HOME/.config/stripe/config.toml. This file contains:

[default]
  device_name = "####"
  live_mode_publishable_key = "pk_live_####"
  test_mode_api_key = "rk_test_####"
  test_mode_publishable_key = "pk_test_####"

[stripe-payments-demo]
  device_name = "stripe-payments-demo"
  secret_key = "sk_test_####"

Environment

Linux Mint 19.1
stripe version 0.6.11 (beta)

Add backfill option

Problem

When I forgot to restart the command to forward webhooks I would like to say "fetch the webhooks of the last x minutes"

Feature

A --backfill=time option where I can say --backfill=2m or --backfill=2h

Examples

I think the two items above covers it.

Support checkout webhooks

Problem

Testing checkout webhook
checkout.session.completed
I cant even find docs what will object checkout.session.completed look like in webhook and cant test with cli and testing on real domains or tunnels is a pain

Feature

trigger checkout.session.completed

Examples

stripe listen does not log when it cannot create a websocket connection

Issue

I'm not sure why stripe listen isn't working - maybe the endpoint is down or I've made a mistake (it was working earlier with no changes on my end).

Regardless, it's super confusing that the CLI says "Ready! Your webhook signing secret..." when in fact the CLI is silently dialing the websocket endpoint and repeatedly failing.

Expected Behavior

I expected the stripe listen to log its connection failures / retries (without having to run the command with --log-level=debug).

Steps to reproduce

Run stripe listen in such a way that it authenticates properly but can't create a websocket connection to stripe-cli.stripe.com.

Traceback

stripe listen --forward-to localhost:4000/webhooks/stripeaccountupdated --print-json --log-level debug
⣾ Getting ready... [Tue, 10 Sep 2019 20:42:17 EDT] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
⡿ Getting ready... [Tue, 10 Sep 2019 20:42:27 EDT] DEBUG stripeauth.Client.Authorize: Got successful response from Stripe display_connect_filter_warning=false reconnect_delay=36 websocket_authorized_feature=webhook-payloads websocket_id={ws-id}websocket_url=wss://stripe-cli.stripe.com/subscribe/{account}
[Tue, 10 Sep 2019 20:42:27 EDT] DEBUG websocket.client.Run: Attempting to connect to Stripe
> Ready! Your webhook signing secret is {secret} (^C to quit)
[Tue, 10 Sep 2019 20:42:27 EDT] DEBUG websocket.Client.connect: Dialing websocket url=wss://stripe-cli.stripe.com/subscribe/{account}?websocket_feature=webhook-payloads
[Tue, 10 Sep 2019 20:42:37 EDT] DEBUG websocket.Client.connect: Websocket connection error error=dial tcp: i/o timeout
[Tue, 10 Sep 2019 20:42:37 EDT] DEBUG websocket.client.Run: Failed to connect to Stripe. Retrying...
[Tue, 10 Sep 2019 20:42:47 EDT] DEBUG websocket.Client.connect: Dialing websocket url=wss://stripe-cli.stripe.com/subscribe/{account}?websocket_feature=webhook-payloads
[Tue, 10 Sep 2019 20:42:57 EDT] DEBUG websocket.Client.connect: Websocket connection error error=dial tcp: i/o timeout
[Tue, 10 Sep 2019 20:42:57 EDT] DEBUG websocket.client.Run: Failed to connect to Stripe. Retrying...
^C[Tue, 10 Sep 2019 20:43:00 EDT] DEBUG proxy.Proxy.Run: Ctrl+C received, cleaning up...
[Tue, 10 Sep 2019 20:43:00 EDT] DEBUG proxy.Proxy.Run: Bye!

Environment

macOS

stripe listen issues get request

When I use stripe listen locally, it works fine.

But when I use it on our test server, the webhooks seem to call GET, rather than POST and my webhook is not set up to serve GET requests:-

[Fri, 16 Aug 2019 16:49:56 BST]  INFO Received event: evt_1F87geDLZTy5tB2lWSjs3aI0 [type: checkout.session.completed]
[Fri, 16 Aug 2019 16:49:56 BST]  INFO Got response from local endpoint, status=405

and in my internal logs:-

[pid: 1091|app: 0|req: 3/9] 192.168.100.52 () {44 vars in 875 bytes} [Fri Aug 16 16:49:56 2019] GET /prices/payment_received/ => generated 0 bytes in 4 msecs (HTTP/1.1 405) 5 headers in 159 bytes (2 switches on core 0)

Is this expected behaviour and I should handle the GET requests? Or is something else going on?

Listener not receiving events

Issue

The command line listener is receiving no events, instead events are being sent to the dashboard.

(The CLI is also telling me to upgrade to 0.7.3 despite being on 0.7.3)

Expected Behavior

The command line listener to receive events, and to not receive them in the dashboard.

Steps to reproduce

  1. stripe login --interactive (Then follow the steps, enter the secret key from the test API Keys)
  2. stripe listen
  3. Open a new terminal tab and run stripe listen checkout.session.completed

Traceback

$ stripe listen
A newer version of the Stripe CLI is available, please update to: v0.7.3
> Ready! Your webhook signing secret is {...} (^C to quit)
$ stripe trigger checkout.session.completed
A newer version of the Stripe CLI is available, please update to: v0.7.3
Trigger succeeded! Check dashboard for event details.

Environment

macOS
cli version 0.7.3

listen command with --load-from-webhooks-api does not work

If I understood docs correctly, when using listen command, I can specify --load-from-webhooks-api which will take all existing webhooks endpoints from existing Stripe test account (visible in dashboard) and will forward only those events that are used by those webhooks.

I have configured webhook in dashboard (pointing to our staging server).
When I use command: stripe listen --load-from-webhooks-api --forward-to localhost:3000/webhook/stripe I get error:
You have not defined any webhook endpoints on your account. Go to the Stripe Dashboard to add some: https://dashboard.stripe.com/test/webhooks

It's not clear to me if it's a bug or I am doing something wrong. Do you have any insights on this topic?

stripe -v
stripe version 0.2.7 (beta)

Authorization failed when running stripe listen with --livemode flag

Issue

When running stripe listen -p segment --livemode --forward-to https://localhost:3000/stripe_webhook I got the following error

you have not configured API keys yet. To do so, run `stripe login` which will configure your API keys from Stripe

I then generated a restricted key from the Stripe dashboard with the write rights for CLI, and added the missing live_mode_api_key in ~/.config/stripe/config.toml for the "segment" project.

When running again the same command, I get the following error:

FATAL Error while authenticating with Stripe: Authorization failed, status=400, body={
  "error": {
    "message": "Cannot create StripeCLI session with a live API key. Try again with a test API key.",
    "type": "invalid_request_error"
  }
}

Expected Behavior

My initial need was to use stripe trigger to replay production events locally and debug our webhook.

If I use the stripe listen command without the flag --livemode and use stripe trigger --event production_event_id, then the listen command doesn't seem to catch the Stripe event. That is why I thought of using the --livemode.

I expected the listen command to run and be able to listen for production events I would trigger using stripe trigger -p segment --event production_event_id.

Steps to reproduce

  1. Run stripe listen -p segment --livemode without the entry live_mode_api_key in ~/.config/stripe/config.toml.
  2. Create restricted key and add it to ~/.config/stripe/config.toml.
  3. stripe listen -p segment --livemode

Traceback

⣾ Getting ready... [Mon, 14 Oct 2019 14:21:42 CEST] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
⣽ Getting ready... [Mon, 14 Oct 2019 14:21:44 CEST] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
⣻ Getting ready... [Mon, 14 Oct 2019 14:21:46 CEST] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
⣽ Getting ready... [Mon, 14 Oct 2019 14:21:48 CEST] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
⡿ Getting ready... [Mon, 14 Oct 2019 14:21:49 CEST] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
⣟ Getting ready... [Mon, 14 Oct 2019 14:21:51 CEST] DEBUG stripeauth.client.Authorize: Authenticating with Stripe...
[Mon, 14 Oct 2019 14:21:53 CEST] FATAL Error while authenticating with Stripe: Authorization failed, status=400, body={
  "error": {
    "message": "Cannot create StripeCLI session with a live API key. Try again with a test API key.",
    "type": "invalid_request_error"
  }
}

Environment

macOS

NCBKSAJE

The more information we have the easier it is for us to help. Feel free to remove any sections that might not apply

Issue

Describe what happened and what you were trying to do

Expected Behavior

Tell us what you expected to happen

Steps to reproduce

What are the steps we can take to reproduce this and verify it's fixed?

Traceback

Share any debug output that was given by the CLI

Environment

Select one of: macOS, Linux, Windows, Other

--project-name doesn't pass through device_name for listen command

Using listen --project-name without a device_name in the [default] profile (even if a device_name) exists in the named project profile results in this error response:

[Thu, 08 Aug 2019 09:18:17 BST] FATAL Error while authenticating with Stripe: Authorization failed, status=400, body={
  "error": {
    "code": "parameter_invalid_empty",
    "doc_url": "https://stripe.com/docs/error-codes/parameter-invalid-empty",
    "message": "You passed an empty string for 'device_name'. We assume empty values are an attempt to unset a parameter; however 'device_name' cannot be unset. You should remove 'device_name' from your request or supply a non-empty value.",
    "param": "device_name",
    "type": "invalid_request_error"
  }
}

Windows command line showing invalid characters

Issue

Describe what happened and what you were trying to do

I ran the stripe executable from the command line and while the connections seem to establish correctly, invalid characters are output to the console window which is both "ugly", but also tricky (i.e. to copy the webhook signing secret).

image

Expected Behavior

Tell us what you expected to happen

I expect the intention is to include these values in quotes, or to mark them up, however apparently the control characters aren't being recognized.

Steps to reproduce

What are the steps we can take to reproduce this and verify it's fixed?

Windows 10 Home
Version 10.0.18362 Build 18362

I followed the very basic steps to download and execute the stripe.exe - nothing fancy. You can see the entire output of the commands I've run in the screenshot above.

Command line codepage is 437 with font Consolas if it matters (grabbed from command properties).

Environment

Select one of: macOS, Linux, Windows, Other

Windows - see above for more details.

please add customer_id to customer.source.expiring event

While I understand the appeal of ONLY sending the "leaf element" object id of the event, as a "best practice" principle, any "element" included the event type path should have its corresponding ID included in the object sent. So in this event case, the event object would ideally include a cus_id AND a src_id included. Currently, only a src_id is being sent.

Our service doesn't hold or track src_id's in our database (no reason to), only a cus_id. The lack of a cus_id in the object prevents me from being able to determine WHICH of our customers has a source expiring, so I'm unable to send them an alert, so this event serves no purpose as I’m unable to determine without going through each customer I have to see which customers source is expiring.

Please add the ID of each enclosed object element. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.