Upon reviewing the Stripe API documentation for creating a verification document in front, it appears that there is no built-in functionality for creating a file using JavaScript. I am looking to implement a client-side solution using React/Javascript to generate a file verification ID.
While I have successfully set up a bank account integration, I encountered an issue when attempting to upload an identity verification file through my React interface. Specifically, when using the stripe.files.create
method, I received an error message stating
Cannot read property 'create' of undefined
. It's worth noting that stripe.createToken
is functioning correctly, indicating that Stripe has been properly integrated into my application.
For context, I am interacting with Stripe on the client side within a React-based environment.
stripeVerification = async () => {
const formdata = new FormData();
formdata.append('file', this.state.picture[0], 'picture');
await this.props.stripe.files
.create({
purpose: 'identity_document',
file: {
data: formdata,
},
})
.then(response => console.log(response));
};