-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to access a rawBody in an endpoint #10831
Comments
Not sure but |
Based on https://github.com/stripe/stripe-node/blob/465c7f326daaa626028efff4c211739e1261921c/src/Webhooks.ts#L29 we want a Can you try // Uint8Array
const webhookPayload = new Uint8Array(await request.arrayBuffer()); https://stripe.com/docs/identity/handle-verification-outcomes#create-webhook or // base64 string
const webhookPayload = (new Buffer(await request.arrayBuffer())).toString('base64'); |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Describe the bug
To validate a request from stripe, I have to provide them the rawBody of the request, but every try throws an error.
I have tried other solutions that I read in other issues that worked for some users but I couldn't make it work
Solution with text: #3384 (comment)
Solution with buffer: #3384 (comment)
I think we have the same error #10339
Reproduction
pnpm dev
this sveltekit app repohave installed the stripe-cli and have an user to test it download stripe cli
do the login for the stripe with
stripe login
connect the cli with the server
stripe listen --forward-to https://localhost:5173/api/with-buffer
in a another terminal run a stripe event, the one I use is payment.intent
stripe trigger payment_intent.succeeded
you can also test the other method with
stripe listen --forward-to https://localhost:5173/api/with-text
Logs
System Info
Severity
blocking an upgrade
Additional Information
No response
The text was updated successfully, but these errors were encountered: