#senakaRan

1 messages · Page 1 of 1 (latest)

uncut flameBOT
plain spoke
#

👋 happy to help

mighty sonnet
#

thanks

plain spoke
#

are you using stripe listen --forward-to?

mighty sonnet
#

Yup

#

webhook is called correctly

#

but return 400 error

#

with Webhook Error: Unable to extract timestamp and signatures from header.

#

some developers say that stripe request includes timestamp info, so it gives this error,

#

I feel lost

plain spoke
#

would you mind sharing a snippet of your code and a screenshot of the terminal where you're getting the error

mighty sonnet
#

Yup moment

plain spoke
#

that's not how you should test your webhook endpoint

#

instead you should use the Stripe CLI with stripe listen --forward-to ... and on another terminal session stripe trigger <fixture>

mighty sonnet
#

I open 2 terminals and run it

#

one is for this: stripe listen --forward-to localhost:4242/webhook

#

another is for : stripe trigger payment_intent.succeed

#

am I wrong?

plain spoke
#

no that's correct

plain spoke
#

could you please make sure that the endpoint secret is the same one from the stripe listen terminal

mighty sonnet
plain spoke
#

that's not the secret that you should use

mighty sonnet
plain spoke
#

but instead you should the one generated when you start the stripe listen command

#

go back in the terminal where you started that command

#

you should find it

mighty sonnet
#

generate?

#

I see

#

what command I have to input to generate it?

#

now this point I am standing...

plain spoke
#

you just run that command

#

it will output a whsec_xxx

mighty sonnet
#

Yup

#

I copied it and use it

#

have still same error

plain spoke
#

would you mind running stripe -v

mighty sonnet
#

stripe version 1.13.8

#

any solution for it?

plain spoke
#

it is the latest version

#

would you mind sharing your account id please?

mighty sonnet
#

stripe account id?

#

acct_1HeGB6HSSJFxb6zy

#

this one?

plain spoke
#

yes please

mighty sonnet
#

that is it

plain spoke
#

yes looking into it

mighty sonnet
#

thanks

vapid orchid
#

Hey! Taking over for my colleague. Let me catch up.

#

Sorry, but could you please summarize your lastest followup question ?

mighty sonnet
#

thanks

#

I tried to implement Webhook to check PaymentIntent Success status.
I just setup the script in my node.js backend project according to the guide.
https://dashboard.stripe.com/test/webhooks/create?endpoint_location=local

Whenever I call "stripe trigger payment_intent.succeeded"
I face this issue:
Webhook Error: Unable to extract timestamp and signatures from header.
Please guide me how to solve this issue:

#

error is coming from this part

#

"Unable to extract timestamp and signatures from header."

plain spoke
#

just fyi, the "Unable to extract timestamp and signatures from header." is only happening when you call it from postman

#

each webhook endpoint has a different secret

#

this is why I asked you to change the webhook endpoint secret when you started the stripe listen command

#

on your server you need to use the webhook endpoint secret that you can find on your dashboard

mighty sonnet
#

I checked the secret correctness

#

moment

#

this one you mean? from dashboard

plain spoke
#

you need to click on reveal

mighty sonnet
#

sorry

#

leave it

#

I will fix the issues

#

but now I face issues on local test

#

that is the staging site

#

I have to solve out the local issue first

plain spoke
mighty sonnet
#

what is wrong with this?

#

I am not clear

plain spoke
#

can you look into that page? under Webhook CLI responses

#

this is were you can find the real error message

mighty sonnet
#

this one you mean?

plain spoke
#

yes

#

so this means that there's something wrong with the signature

#

it goes back to the webhook endpoint secret

mighty sonnet
#

Thank you

#

let me check again

plain spoke
#

make sure you're not running multiple instances of Stripe CLI stripe listen

mighty sonnet
#

multiple instances?

#

when I run the command "stripe trigger payment_intent.succeeded"

plain spoke
#

no I meant if you're running the command on multiple terminals on the same time

mighty sonnet
#

3 events are running

plain spoke
#

I don't mean the events

mighty sonnet
#

I see

#

ok

#

not at this moment in my side

#

sorry

#

one more question plx

#

plz

#

app.post('/webhook', express.raw({type: 'application/json'}), (req, res) => {
const sig = req.headers['stripe-signature'];

#

if I set express.raw(): TypeError : Express is not a function error

#

I face this

#

what is the solution for this issue?

plain spoke
#

are you using express as your nodejs server?

mighty sonnet
#

so now I set "bodyparser.raw" instead of it

plain spoke
#

you need to import express

mighty sonnet
#

yes

#

I think I did

plain spoke
#

that's a different file right?

mighty sonnet
#

yes but

#

in the file also imported

plain spoke
#

you need to reimport

#

in the other file

mighty sonnet
#

in the file express imported

#

is this related with router ?

#

I am not sure really!

summer wind
#

Hi, I'm taking over my colleague!
Please give me a moment to catch up.

summer wind
mighty sonnet
#

current issue I have

summer wind
#

What version of express are you using?

mighty sonnet
#

"express": "~4.16.1",

summer wind
#

Try updating the package

mighty sonnet
#

Thanks

#

we can close the window right now

#

enough for me

#

thanks

summer wind
#

Happy to help. Let me know if you have any other questions.

mighty sonnet
#

thanks