#dylan-quote-download
1 messages ยท Page 1 of 1 (latest)
Hi ๐ I'm not sure I'm grasping the question, would you mind elaborating?
Quote objects don't seem to have a field that relates to them having a downloadable file associated with them:
https://stripe.com/docs/api/quotes/object
Ah good spot, thank you!
In that case, I believe the flow you would want is:
- Have your FE make a request to your BE to get the file
- Download the file on your BE
- Provide the downloaded file in the response that your BE provides to your FE
euh my back end is supabase i can t use it as i please
or is there a posibility to see a preview like on the dashboard ?
I'm not sure if these can be previewed in the dashboard, we primarily help with our API in this forum.
There does seem to be a way to download the Quote PDF from the dashboard, but I've not used it before so I'm not exactly sure how it works:
https://stripe.com/docs/quotes/create?testing-method=without-code#send-quote-dashboard
Can you elaborate?
Apologies for not being clear, can you tell me more about how you're making the request?
export const downloadQuote = async (quoteId: string) => {
const pdf = await stripe.quotes.pdf(quoteId)
}
const stripe = new Stripe(process.env.NEXT_PUBLIC_STRIPE_SECRET_KEY, {
apiVersion: '2022-11-15'
})
To make sure I'm understanding correctly, you're trying to include stripe-node in your site and use that server-side library to make this request from your client-side code?
I'm using next js and it's working for other request
Hm, so I'm still not sure I understand how you've implemented. If you are pulling stripe-node into your client-side code and trying to use it to make a request from there, then I wouldn't be surprised if that doesn't work well.
When using nextjs the server is running on node server
Hm, but isn't CORS is a front-end limitation implemented by browsers to prevent sites from trying to access other sites? How is that impacting requests made from server-side code?
there is server side on next i guess i should use it
My question was about downloading a quote from the front end
Sounds like you are running into a CORS issue?
yes
You would need to call your backend in this case and download from there and then return to your frontend.
You can't download a quote directly from the frontend.
yes but i am using supabase
Sorry, I'm not familiar with supabase
ah and there is no wau to see quote from the front end ?
dylan-quote-download
No way to download it, no.
oh so it's gonna be a feature soon?
and if you want i have got other things that i need and are not available for the moment