#codecoolkid
1 messages · Page 1 of 1 (latest)
Is this your backend code?
yes this is in nodejs
Im getting the image through URL from one of our servers with axios
Okie, do you see the request in https://dashboard.stripe.com/test/logs?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Oh perfect let me check had no idea there were logs sec
Interesting is not getting to the logs
What is file.data expecting like a buffer, base64 are this accepted?
oh my god I think I just made it work
leaving here the code for context:
const response = await axios.get(URL, { responseType: 'arraybuffer' })
const buffer = Buffer.from(response.data, "utf-8")
var stripeFile = await stripe.files.create({
purpose: 'identity_document',
file: {
data: buffer,
name: file?.key,
type: 'application.octet-stream',
},
});
Thank you I believe the method on fetching the image wasn't expected by stripe just convert it to a buffer and worked, thanks for the logs url! Very helpful