Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot test connect webhook events using local listener #1089

Open
lenardchristopher opened this issue Jun 25, 2023 · 1 comment
Open

Cannot test connect webhook events using local listener #1089

lenardchristopher opened this issue Jun 25, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@lenardchristopher
Copy link

Issue

I am trying to debug some failing connect events using the webhook local listener.

Expected Behavior

When running the listener, I expect Stripe to forward events to my local webhook. This expected behavior is how I'm reading the Stripe documentation here.

Optionally, if you’ve already registered your endpoint in Stripe, use the --load-from-webhooks-api and --forward-to flags.

stripe listen --load-from-webhooks-api --forward-to localhost:5000

This command forwards events sent to your Stripe-registered public webhook endpoint to your local webhook endpoint. It loads your registered endpoint, parses the path and its registered events, then appends the path to your local webhook endpoint in the --forward-to path. If you’re checking webhook signatures, use the {{WEBHOOK_SIGNING_SECRET}} from the initial output of the listen command.

Steps to reproduce

  1. Setup a connect webhook in Stripe. Something like this
Screenshot 2023-06-25 at 2 39 20 PM
  1. Run a webhook handler locally (for me, localhost:7185)
  2. In a terminal, run stripe listen --load-from-webhooks-api --forward-to localhost:7185 --forward-connect-to localhost:7185. Observe the listener in active in Stripe Dashboard.
  3. Create and confirm a payment intent for a connect account using Stripe API in order to trigger payment_intent.succeeded event
  4. Observe that an event is recorded for the webhook in Stripe Dashboard, but no event triggers for the Stripe CLI listener.

Traceback

None

Environment

macOS

@lenardchristopher lenardchristopher added the bug Something isn't working label Jun 25, 2023
@Moongazer
Copy link

I had the same issue, that "real" webhook calls for events (triggered during the test checkout process on a local dev machine) was not forwarded back to the local machine. The missing part for me was --forward-connect-to localhost:1234! After adding that to CLI startup, the local webhook handler are called now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants