#dux_code
1 messages ¡ Page 1 of 1 (latest)
đ 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.
I basically need to get access to the payment method after confirming a setup intent
on the front-end
hagrid
is that you?
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.
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..)
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?
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.
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
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.
Have a look here at the properties that say "retrievable with publishable key": https://docs.stripe.com/api/payment_intents/object
And this is the method you would use on the frontend: https://docs.stripe.com/js/payment_intents/retrieve_payment_intent