#s0__0 - CLI webhook secret

1 messages ยท Page 1 of 1 (latest)

fluid karma
#

When you start stripe listen it should be part of the output

zinc siren
#

it is equal to client_secret ?

fluid karma
#

client_secret where?

#

Oh for the parameter where you verify the webhook signature? Yes, that is where you put the secret.

zinc siren
#

my error is occur in line 23

#

Stripe\Exception\SignatureVerificationException: No signatures found matching the expected signature for payload in /home/xxxxxx/domains/xxxxxx.net/private_html/plugin/stripe_api/full/lib/Exception/SignatureVerificationException.php:28

royal iris
#

Hi ๐Ÿ‘‹ I'm stepping in for @fluid karma

zinc siren
#

so i am just wondering if my $endpoint_secret is wrong, as i just copy from the webhook generator.

royal iris
#

And you are using stripe listen?

zinc siren
#

nope

#

i am using paymentIntents

royal iris
#

But you mention above

how can i found my Stripe CLI webhook secret?

#

stripe listen is the CLI command for listening to webhook events

zinc siren
#

what is stripe listen?

royal iris
#

WHen you run it, you will get a webhook signing secret value printed out in your terminal

#

that starts whsec_XXXXXXXX

zinc siren
#

i think i am not using listen

#

i am not looking at this doc

royal iris
#

Okay, so you have configured a webhook listener through the API or your Stripe dashboard?

royal iris
#

Okay what is it you are trying to do?

zinc siren
#

in point 6 now

#

this is my webhook

#

in stripe, it tells me 400 error

royal iris
#

Okay but you need to let Stripe know where to send the requests

#

Did you use the Dashboard webhook tool?

zinc siren
#

yes!

#

i have register the url

#

and my programme gave a 400 error to stripe

#

Stripe\Exception\SignatureVerificationException: No signatures found matching the expected signature for payload in /home/yudansnet8/domains/yudans.net/private_html/plugin/stripe_api/full/lib/Exception/SignatureVerificationException.php:28

royal iris
#

Okay, so that is a different webhook signing secret.

zinc siren
royal iris
#

You will need to look in the Webooks table of the Developer page in your Stripe Dashboard.

zinc siren
#

yes, i press retry several times, still 400

royal iris
#

What is the error message you are seeing?

zinc siren
#

pi_3KlEjvGRGdCFkMmo1wjSRy3a

zinc siren
# royal iris What is the error message you are seeing?

Stripe\Exception\SignatureVerificationException: No signatures found matching the expected signature for payload in /home/yudansnet8/domains/yudans.net/private_html/plugin/stripe_api/full/lib/Exception/SignatureVerificationException.php:28

royal iris
#

Okay so have you tried copying your webhook secret from your Dashboard table?

#

Have you tried adding any sort of logging to your PHP webhook code?

zinc siren
#

this is my webhook , just copying from stripe webhook generator

#

i have just only add insertErrorLog() for my error checking

royal iris
#

Right, and that's fine if it's working for you. However, if you keep getting an error then maybe you need to change some things

zinc siren
#

in line 7 , where can i find this key? or this is correct now?

#

this code is not fine right now, it say 400 in line 26

#

becuase of invalid signature

royal iris
#

You click on your registered webhook and in the table it will have your webhook Status, the Events you are listening for the API version, and the Signing Secret. You will need to click "Reveal" to show the secret.

#

You can then copy/paste the value.

zinc siren
#

oh got it! its fine right now

royal iris
#

Great ๐Ÿ‘

zinc siren
#

can i add my parameter here, to reconize which order is paid when i receive a webhook?

#

or using PaymentIntent id is safer?

royal iris
zinc siren
#

after webhook received success msg, do i have to check again with my database that the product info and price are match?

#

or i can trust all the data in webhook with not only the success status?

royal iris
#

The entire payment intent object will be returned in the webhook data payload so you can inspect it there if you wish. I would test it out and make sure the behavior is what you expect.

zinc siren
#

okok many thanks