Webhook doesn't respond to event sent by Stripe

Hi all,
Below is the result of a test. How do we debug a no response?
Both the payment_intent.succeeded and the checkout.session.completed give a 400 bad request.

Hi community,
I spoke to Stripe experts who are saying that the Wappler webhooks should give back a response to the incoming Stripe events.
Could this be looked into by the Wappler devs, are the webhooks up to date?
Thank you :slight_smile:

I assume you are using PHP. Not sure if the error is because of the outdated SDK. You can download the latest version from https://github.com/stripe/stripe-php/releases, unzip the file to dmxConnectLib/stripe. I will also see that we will upgrade it within Wappler. Let me know if the latest SDK fixes the problem.

The 400 error is returned when there is an invalid payload or invalid signature. So please double check if your endpoint secret is correct.

index.zip (691 Bytes) Unzip the file in dmxConnect/webhooks/stripe.

I’ve added the error message to the output, that would help debugging.

Are these two files included in today’s upgrade?

No, they need to be tested first and there was no time to include them in todays update

Indeed, now I get a useful response:

“message”: “Cannot access protected property Stripe\Exception\SignatureVerificationException::$message”,

Which I assume means my Signing secret key is incorrect. And this is where I paste it, right? (all in test mode)
image

The Endpoint Secret is used for the webhook. Check that you copied the correct one, you can have multiple endpoints configured.

Thanks, after I copy it from our dashboard https://dashboard.stripe.com/test/webhooks (test mode) into the SC settings I get this different whsec when I run a test:


Is it because my site is live?

Is there any in depth tutorial on webhooks with Wappler?

When you run the Stripe Webhooks CLI in Wappler it creates a special local test mode with its own secret.

This is the secret you see displayed in the terminal and it is automatically used by Wappler when you choose to test a webhook from the context menu.

The endpoint secrets you enter in the server connect options are the ones for your live site. So you should enter your live url and secret there - not the test one.

It is all explained in the docs

Well noted. Live keys back into the SC settings.
But why do i get a 500 error when I run a test from both Wappler’s context menu or Stripe dashboard?


Is that because it is Standard Connect account and as a platform, I should test from the Connected Account point of view?

Well 500 means that you server connect actions in the webhooks are giving some kind of error in their actions, so could enable the debugging and see what is going on.

Patrick provided a fix for debugging webhooks, here is the error message whether i test from wappler or our stripe dashboard:

“Cannot access protected property Stripe\Exception\SignatureVerificationException::$message”

I’m in test mode, my keys are correct now (there’re only two choices anyway).

Normally the message property of an exception is public, not sure why they would make it a protected property. The SignatureVerificationException means that the signature verification failed. Normally this means that you used the wrong secret.