#forthepowersthatb

1 messages · Page 1 of 1 (latest)

idle charmBOT
snow sable
#

Hello

ionic sinew
#

hi

snow sable
#

Overall this is a fine way to do it — having extra PaymentIntents created will clutter your Dashboard, but there is no real negative affect of creating a PaymentIntent every time. That said, another way to handle this is to use something like a session cookie and then use the same PaymentIntent for that session unless the cart actually changes.

#

You can't render Payment Element without the clientsecret, no.

ionic sinew
#

ah ok thanks. i wasnt sure if you could render payment form without client scret

snow sable
#

We are working on supporting this in the future, but not possible at the moment.

ionic sinew
#

so then the everytime this page loads it will have to call the api, no way around that

#

ok thanks!

snow sable
#

Well like I noted, you could use a cookie as a workaround

ionic sinew
#

i dont think JS can read cookies

snow sable
#

You would add logic to check if a PI has already been created for that Customer based on the cookie.

#

You would still need to call your backend on page-load, yes.

snow sable
#

Yep it would be based on the data you store with the cookie and you would check it in your backend

ionic sinew
#

ok good to know thanks