#dylan-quote-download

1 messages ยท Page 1 of 1 (latest)

shrewd ingotBOT
muted sandal
#

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

zealous sand
#

there is a way to download it from the back-end but i need it from the front-end

muted sandal
#

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
zealous sand
#

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 ?

muted sandal
#

I'm not sure if these can be previewed in the dashboard, we primarily help with our API in this forum.

zealous sand
#

i'm using this method but i have got a cors error

muted sandal
#

Can you elaborate?

zealous sand
#

but i doing other request without any problems

muted sandal
#

Apologies for not being clear, can you tell me more about how you're making the request?

zealous sand
#
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'
})
muted sandal
#

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?

zealous sand
#

I'm using next js and it's working for other request

muted sandal
#

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.

zealous sand
#

When using nextjs the server is running on node server

muted sandal
#

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?

shrewd ingotBOT
zealous sand
shut igloo
#

๐Ÿ‘‹ stepping in here

#

Are there outstanding things I can help with Dylan?

zealous sand
#

My question was about downloading a quote from the front end

shut igloo
#

Sounds like you are running into a CORS issue?

zealous sand
#

yes

shut igloo
#

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.

zealous sand
#

yes but i am using supabase

shut igloo
#

Sorry, I'm not familiar with supabase

zealous sand
#

ah and there is no wau to see quote from the front end ?

shrewd ingotBOT
livid pulsar
#

dylan-quote-download

shut igloo
#

No way to download it, no.

zealous sand
#

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

shut igloo
#

You can't download a quote from frontend because it wouldn't be secure

#

You have to hit your backend to handle a quote

#

Feel free to let me know about other stuff. We are always happy for feedback

zealous sand
#

so when you use stripe as french you need to add siret number and customise quotes/invoice and there are other informations missing

#

(we have a lot of laws to respect ^^ when making quotes/invoices)