#dux_code

1 messages ¡ Page 1 of 1 (latest)

long peakBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1272946375058915428

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

glad urchin
#

I basically need to get access to the payment method after confirming a setup intent

#

on the front-end

#

hagrid

#

is that you?

ruby geode
#

Hello! The Payment Method is partially accessible with a publishable key on the frontend, but to access the full Payment Method you need to fetch it with a secret key on your server, then relay the relevant information to your frontend from there.

glad urchin
#

what is partially

#

what method can I use to see what info i can get

#

the front-end version might be sufficient depending on what it returns - i just need like the last 4 digits and the card type (visa etc..)

ruby geode
#

Hang on, I'm confused. I thought you said you were already getting the Payment Method details after confirming setup, but not all of them, right?

glad urchin
#

i'm only getting the payment method id

#

from confirming the setup

ruby geode
#

Oh, this made it sound like you were getting more than that: "can confirm setup return the payment method details (not only ID)?"

#

In any case, those properties will need to be fetched with a secret key on your backend.

#

Then relayed to your frontend.

glad urchin
#

why cant we fetch on the front-end though, i dont undestand

#

we can create a payment method on the front-end and it returns the full payment method info

#

but why cant we fetch it to get the same exact info

#

anyway. its not something that can be changed right now

#

thanks

ruby geode
#

You can't fetch the full Payment Method details on the frontend because they're considered sensitive, and require a secret key to retrieve.

#

You can fetch the Payment Intent or Setup Intent using the client secret and your publishable key, but you'll only get a subset of the properties, not all of them.