Rank 1: Thread
I'm trying to use a payment services webhook and verifying the signture. I'm having some trouble with processing payload.
the webhook.verify function in standardwebhooks library requires a string or a Buffer payload (as seen in error in image 2)
When I try it in a local express app. I do this- (see commented code 1)
(the express.raw at the top allows me to access the raw payload without express preprocessing it) I log the response to see types if payload and it comes like this [image 1],
notice the payload is type buffer, i convert it to string and pass it to function.
This works.
Now when I replicate the same thing in appwrite - (see commented code 2)
, the payload is coming in as object and I think that is causing issues with webhook.verify function, getting a response like this [image 2]
What I suspect is happening is appwrite preprocesses the payload and converts it from buffer to object.
Here are some questions I have .
- is there a way to stop this preprocessing like I'm doing in express and get a raw buffer payload.
- can I use express in an appwrite cloud function and do it like that.
- any other way I can verify the signature, I suspect this should be something similar to what stripe uses, so if you have verified stripe payload maybe that would apply here as well.
Thanks in advance!