#c6llb

1 messages · Page 1 of 1 (latest)

peak sedgeBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

  • c6llb, 6 hours ago, 19 messages
meager whale
#

nope, another problem

olive sky
meager whale
#

yup

#

i'm

#

??

#

No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing
fail
No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing
fail
No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing
fail
No signatures found matching the expected signature for payload. Are you passing the raw request body you received from Stripe? https://github.com/stripe/stripe-node#webhook-signing

Still, 4 errors, on each request

GitHub

Node.js library for the Stripe API. . Contribute to stripe/stripe-node development by creating an account on GitHub.

late forum
#

This error typically means that the webhook signature you passed is not correct. You need to confirm that you're not tampering it and using the raw string.

meager whale
#

so JSON

late forum
#

That is correct, it needs to be raw to match the exact webhook signature.

meager whale
# late forum That is correct, it needs to be raw to match the exact webhook signature.

exports.saveOrder = catchAsync(async (req, res, next) => {
const payload = req.body;
const sig = req.headers['stripe-signature'];

try {
const event = stripe.webhooks.constructEvent(
JSON.stringify(payload),
sig,
process.env.STRIPE_WEBHOOK.trim()
);
} catch (e) {
console.log('fail');
console.log(e.message);
return res.status(400).json({});
}

res.status(204).json({});
});

Still not working

#

I don't know if this note is important or not, but i'm in test mode

late forum
#

It does not matter if it's test mode or not

meager whale
#

then why is the error

#

I'm sure that the secret is correct, i've logged it

#

and made sure

late forum
#

Do you have any plugins that maybe be tampering with it? If you pass the webhook signature manually const sig does it work?

meager whale
#

t=NIMBER,v1=NUMBER,v0=NUMBER

#

This is what the header stripe-signature looks like

#

is it good? like it haves some commas

late forum
#

You'd want to manually copy and paste that on the signature above.

meager whale
#

I did not understand

#

i have the webhook signing secret

#

correct

meager whale
late forum
meager whale
#

I can't understand

#

do you meen by signature the whsec?

late forum
#

Yes, exactly

meager whale
#

how? like as what?

#

must i declare the sig variable as the whsec?

#

it worked

#

but this is not safe

#

that will make anyone can ping the /orders

#

then he can make an order without even paying

late forum
#

So great! That means that something on your end is tampering with the raw webhook secret

meager whale
#

ok, so that was only for debugging

late forum
#

So you'd want to debug this on your end and ensure that wsec_ is raw

#

yes

meager whale
#

yes