#anat_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1257600593414062110
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Are you asking if you can conditionally hide the Link Authentication element?
Yes, or in the case the user has a Link account (connected with email in default values), I would like to "hide" the card element. I would like an implementation "close" to the checkout experience
Ok, I know react supports conditional rendering, but 'm not familiar with svelte so I don't know if this framework provides something similar, you might want to check its document.
Mmh, the thing is I'm searching for the right hook to know if the user is connected or not. Maybe you have a sample ? (even in React no problem ๐)
mmh my bad I'm surely not clear. Svelte supports conditionnal rendering, the thing is how can I determine the "state" of the Link Authentication ?
Here a screenshot, maybe it's gonna be more clear ๐
Here I created a Link Authentication element with a default value email, Stripe detected I have an account, so it shows me the PIN Code input.
And in what condidtion do you want to hide it?
Is it more clear ?
If a user has Link account based on his email, I would like to hide card element. If the user has no Link account, hide the Link authentication element.
OK, so the real question here is how to retrieve information from Stripe that tell you whether the customer has a link account with the provided email, am I right?
It could definitly be a way yes !
I am not sure something like this exists, unfortunately.
The Link Authentication Element doesn't share much info about it: https://docs.stripe.com/js/element/link_authentication_element
Yes I read it haha. I'm wondering how the checkout product works then
Because on the checkout Link if automatically showed if user has an account and if not, it shows the credit card section
It happens internally in Stripe, I don't think we make this capability available externally.
What do you see if the Link account doesn't exist?
Do you use both Express Checkout Element and Link Authentication Element?
Yes !
Why?
Mmh in fact the Express Checkout is for Apple Pay and Google Pay. The Link green button is gonna be removed ๐
It should display all available buttons.