#ayushh_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/1423597324508074075
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
hi
this error is quite common. can you try all the steps mentioned here: https://docs.stripe.com/webhooks/signature
lemme check a moment please
when I print the body, i can see the data, but still the 400 exists
did you check the webook secret? that's the first thing to check.
when I print the body,
is it printed as a string, or an object?
I can see its an object
then that's the issue, it should be a string.
oh, how should I fix it ?
it's explained in the doc I shared
can you share related doc to hono?
I don't understand the question, sorry.
the doc has information about express and NextJS
but I m building it with hono cloudflare worker
so is there a doc related to hono available so i can quickly check that and add it to the code?
I found this to be the most relevant https://github.com/stripe-samples/stripe-node-cloudflare-worker-template/blob/main/src/index.js but it doesnt' seem to work
we don't know anything about hono cloudflare worker, sorry.
so you'll need tofind a way to get the raw payload of the event without any modifications.
sure
so as I said, I have multiple routes like
routes/
authRoutes.ts
webhookRoutes.ts
index.ts
when I integrated my webhook code similar to this in my index.ts
https://github.com/stripe-samples/stripe-node-cloudflare-worker-template/blob/main/src/index.js
it worked
but when I add the webhook code in webhookRoutes.ts it gives 400
what type of 400? a signature verification error?
the same Webhook signature verification failed: CryptoProviderOnlySupportsAsyncError: SubtleCryptoProvider cannot be used in a synchronous context.
I'm confused. the error you just pasted is not a webhook signature error.
can you share the full error message?
â [ERROR] Webhook signature verification failed: CryptoProviderOnlySupportsAsyncError: SubtleCryptoProvider cannot be used in a synchronous context.
at SubtleCryptoProvider.computeHMACSignature
got it. it seems the error comes from CryptoProviderOnlySupportsAsyncError, which is not a Stripe function.
okay
so you'll need to double check your code on your end, and add some logging, to better understand what the issue is.