#jmontydesign-payout-webhooks

1 messages · Page 1 of 1 (latest)

toxic yew
#

When an event is sent to a connect webhook endpoint, that event should have account populated (https://stripe.com/docs/api/events/object#event_object-account) which will tell you which account the event came from. In your current test set up are you listening for the payout.paid events from a connect endpoint?

storm raven
#

Using the Stripe Cli I enterred "stripe listen --forward-connect-to localhost:5001/api/stripeWebhooks" and then the trigger "stripe trigger payout.created --stripe-account acct_1KRnNnRFu7a83Dyz" I see in the dashboard for the connected account that the event is happening and the terminal it shows successfully, but the server endpoint at "localhost:5001/api/stripeWebhooks" is not logging the event. Any thoughts?

toxic yew
#

Are you seeing any output from the stripe listen command confirming that the payout.created is being seen by the CLI?

storm raven
#

yes 2022-02-11 16:46:53 --> connect payout.created [evt_1KS9lJRFu7a83DyzKzwSBspF]
2022-02-11 16:46:53 --> connect payout.updated [evt_1KS9lJRFu7a83DyzRFaVpv56]
2022-02-11 16:46:53 --> connect payout.paid [evt_1KS9lJRFu7a83DyzT3lRx4L6]

toxic yew
#

Are you seeing any logging on your server endpoint at all?

storm raven
#

none for the event

#

handleStripeWebhooks = async (req, res, next) => {
try {
const sig = req.headers["stripe-signature"];
const endpointSecret =
"whsec_89bf99f73c5f27ea846012cb89b52737de5e659a59013b4d330b60b74eacd223";
let event;
try {
event = this.stripe.webhooks.constructEvent(req.body, sig, endpointSecret);
console.log(event);

toxic yew
#

Do you see other logs? You should add basic logs to your endpoint before signature verification just to confirm that things are hitting the endpoint at all

storm raven
#

The endpoint was working fine with "stripe listen --forward-to localhost:5001/api/stripeWebhooks" but when I change to "--forward-connect-to" the endpoint doesn't receive any events.

#

It worked now! Sorry. It is working. Thanks!

toxic yew
#

Oh awesome! What ended up being the issue?

storm raven
#

I don't know I went back and forth between "--forward-connect-to" and "forward-to" and it started working. I must have mistyped or something.

#

... actually a bunch of events came flooding in, perhaps there was a delay.