#ugudango_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1225787893902217288
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! what's the event ID evt_xxx of a webhook event where this happens?
can you share the exact code you're using in your endpoint?
hi there, sure thing: evt_1P290RFQ18ENc13dZR3u5p9j, and the code is:
your implementation of buffer is different from what we have at https://github.com/stripe/stripe-node/blob/master/examples/webhook-signing/nextjs/pages/api/webhooks.ts#L56 , which could make a difference.
I'd start anyway by console.log(buf) just above constructEvent and see what that prints. And printing the webhookSecret and letting us know the last 4 chars just to check it's the expected one
mhm, let me try that
our file is not typescript, so will this do?
const buffer = (req) => {
return new Promise()((resolve, reject) => {
const chunks = [];
req.on('data', (chunk) => {
chunks.push(chunk);
});
req.on('end', () => {
resolve(Buffer.concat(chunks));
});
req.on('error', reject);
});
};
not sure, seems ok at first glance
buf: <Buffer 7b 0a 20 20 22 69 64 22 3a 20 22 65 76 74 5f 31 50 32 43 4b 72 46 51 31 38 45 4e 63 31 33 64 52 4f 68 57 49 78 64 75 22 2c 0a 20 20 22 6f 62 6a 65 63 ... 875 more bytes>
secret last 4 chars: rWY7
oh wait, I made a mistake
i sent you a production event ID and this is a development secret
yeah that could be the problem
evt_1P2BuoFQ18ENc13dv1D8tE4Q this is an event ID from dev
the secret for that endpoint should be the one ending in IFGs
that is in production yes
what do you suggest? is the secret rWY7?
for that other evt ID?
Yeah that looks to be the correct one for your test endpoint
but i am still getting the error
Ok so you have a production and a test integration?
And they're both failing?
Have they ever worked?
it stopped working as we migrated our Stripe account to a new Stripe.. I changed API keys and secret keys, as well as webhook secret
previously it worked fine
but minimal changes to the code was made, the webhook part was not even touched :/
Ah ok that context helps
So it was working with the same code on the previous stripe account?
Did your infra change at all?
infra as in infrastructure?
same
I see. Nothing changed at all there? Not config changes?
Because that's a common cause for the error you're getting
i mean there were minimal changes, especially to that file
config as what exactly? .env file or something else?
Specifically infra config changes