#ayushh_webhooks

1 messages ¡ Page 1 of 1 (latest)

bleak mothBOT
#

👋 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.

native talon
#

hi there!

proper kiln
#

hi

native talon
proper kiln
#

lemme check a moment please

#

when I print the body, i can see the data, but still the 400 exists

native talon
#

did you check the webook secret? that's the first thing to check.

proper kiln
#

yes

#

that's right

native talon
#

when I print the body,
is it printed as a string, or an object?

proper kiln
#

I can see its an object

native talon
#

then that's the issue, it should be a string.

proper kiln
#

oh, how should I fix it ?

native talon
#

it's explained in the doc I shared

proper kiln
#

can you share related doc to hono?

native talon
#

I don't understand the question, sorry.

proper kiln
#

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?

native talon
#

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.

proper kiln
#

oh

#

hi

#

are you still there?

native talon
#

sure

proper kiln
#

so as I said, I have multiple routes like
routes/
authRoutes.ts
webhookRoutes.ts
index.ts

#

but when I add the webhook code in webhookRoutes.ts it gives 400

native talon
#

what type of 400? a signature verification error?

proper kiln
#

the same Webhook signature verification failed: CryptoProviderOnlySupportsAsyncError: SubtleCryptoProvider cannot be used in a synchronous context.

native talon
#

I'm confused. the error you just pasted is not a webhook signature error.

#

can you share the full error message?

proper kiln
#

✘ [ERROR] Webhook signature verification failed: CryptoProviderOnlySupportsAsyncError: SubtleCryptoProvider cannot be used in a synchronous context.

  at SubtleCryptoProvider.computeHMACSignature
native talon
#

got it. it seems the error comes from CryptoProviderOnlySupportsAsyncError, which is not a Stripe function.

proper kiln
#

okay

native talon
#

so you'll need to double check your code on your end, and add some logging, to better understand what the issue is.

proper kiln
#

and finally was able to fix

#

Thanks for your support