stripe-cli
stripe-cli copied to clipboard
Local listener URL not triggering full webhook URL in Stripe CLI
Issue
When forwarding a local URL via Stripe CLI like this:
stripe listen --forward-to http://localhost:44383/myapp/index.php?option=app1&task=stripe_webhook --latest
in https://dashboard.stripe.com/test/webhooks i see the URL without parameters http://localhost:44383/myapp/index.php?option=app1
The task parameter is lost.
When triggering like this:
stripe trigger payment_intent.created
Setting up fixture for: payment_intent
Running fixture for: payment_intent
Trigger succeeded! Check dashboard for event details.
the listener tells:
> Ready! You are using Stripe API Version [2020-08-27]. Your webhook signing secret is ________________________________________
2022-05-06 15:31:18 --> payment_intent.created [evt___________________]
2022-05-06 15:31:18 <-- [404] POST http://localhost:44383/myapp/index.php?option=app1 [evt___________________]
I tried encoding the URL in different ways without success.
When creating the same POST call in Postman evereything works fine.
I'm using the latest CLI v1.8.11
Any ideas?
Expected Behavior
Full URL should be triggered like in POSTMAN
Environment
Windows
Do you remember how you solved it? For me it's still not posting the payment_intent object like in your example
I already called support, but here's the issue in my case:
stripe listen
doesn't post "payment_intent.succeeded" like the docs said it would. More detail: When I trigger this command : " stripe listen --forward-to localhost:4242/webhook
" with " stripe trigger payment_intent.succeeded
", I get this output in my console instead of what the documentation at https://stripe.com/docs/payments/handling-payment-events says I SHOULD get : 2022-09-10 22:35:07 --> payment_intent.succeeded [evt_3LgcGTGNUfwSKW710i7um8W1] 2022-09-10 22:35:07 <-- [200] POST [http://localhost:4242/webhook](http://www.google.com/url?q=http%3A%2F%2Flocalhost%3A4242%2Fwebhook&sa=D&sntz=1&usg=AOvVaw0k5mKI-c4CNBxJaOwZp5S-) [evt_3LgcGTGNUfwSKW
As you can see, it posts the URL but not the data we want: the "payment_intent.succeeded
" . Again, basically, the stripe
CLI doesn't post "payment_intent.succeeded" like the docs said it would.
:)
Any updates on this? I'm not receiving any request on my endpoint also
I am also not receiving any requests at my endpoint with Strupe CLI. When using cURL to send a mock request, everything is working. Any help?
I am on a Windows machine. What worked for me was going to
- Windows Defender Firewall with Advanced Security
- Inbound Rules (top left)
- Then press "New Rule..." (top right)
- Select Port
- Select TCP
- Select "Specific local ports". Here write down the port that you are running your server on. (3000, 30000, whatever it is)
- Select "Allow the connection"
- Leave all the rules applied
- Then press next and give it a name
Just in case any other got on my error, the command stripe listen --forward-to localhost:8888/my-webhook-endpoint
must be running meanwhile execute stripe trigger [event]
stripe trigger send an event to stripe listen and finally stripe listen send this request to your localhost