#sandeepdil
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
error screenshot
would you mind sharing your code?
var fp = fs.readFileSync(path_resolve.resolve(__dirname, "../Public/Profile/"+file_url));
console.log(fp,"fp-----------------")
return await stripe.files.create({
purpose: doc_for=='bank' ? 'account_requirement' : 'identity_document',
file: {
data: fp,
name: file_url,
type: 'application/octet-stream',
},
}).then( ( result ) => {
console.log(result,"===========1==========>stripe_createFile")
return result.id;
} ).catch( (stripe_error) => {
console.log(stripe_error,"===========2==========>stripe_createFile")
return false;
} );
var fp has buffer type already
do you have a request ID?
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req id will be generated only once request will be init... but the error is in your npm package
i shared screenshot... see in that
which version of the npm package do you have installed
the latest i have with node version 18.7.0
all other apis are working fine only getting issue with files.create
v12.1.1 ?
Was just trying to check if fb has buffer data or not.... It has buffer data of file
would you mind sharing the screenshot for this console.log
Hey! Taking over for my colleague.
Can you please share more details about path_resolve.resolve(__dirname, "../Public/Profile/"+file_url) ? and can you try to use an absolute path, something like `/path/to/file...``
Can you share your package.json too please ?
Can you please share your package.json ? Node (18) and Npm version also?
Can you share the code you've used for this test ?
var fp = fs.readFileSync(path_resolve.resolve(__dirname, "../Public/Profile/"+file_url));
console.log(fp,"fp-----------------")
return await stripe.files.create({
purpose: doc_for=='bank' ? 'account_requirement' : 'identity_document',
file: {
data: fp,
name: file_url,
type: 'application/octet-stream',
},
}).then( ( result ) => {
console.log(result,"===========1==========>stripe_createFile")
return result.id;
} ).catch( (stripe_error) => {
console.log(stripe_error,"===========2==========>stripe_createFile")
return false;
} );
im using node 18.7.0 and stripe npm package 12.1.1
Can you please do a test for me and remove path_resolve.resolve(__dirname, "../Public/Profile/"+file_url) and set absolute path /path/to/file?
I invite you to share with us a simple .js file that we can reproduce the issue with...
You can refer to this sample as a base...
const stripe = require("stripe")('YOUR_SECRET_KEY');
const fs = require('fs');
app.get("/debug", async (req, res) => {
var fp = fs.readFileSync('/path/to/file/file.jpeg');
var file = await stripe.files.create({
purpose: 'dispute_evidence',
file: {
data: fp,
name: 'file.jpg',
type: 'application/octet-stream',
},
});
res.send({file});
});
Ok let me try this code
i checked , facing same issue
https://live.uprizenow.com:4000/test/stripe_debug
error is showing in stripe npm package
I invite you to share a sample complete project ( with package.json) so that we can reproduce.
yes please
Hi! I'm taking over my colleague. Please, let me know if you have any other questions.