#vish_code

1 messages ¡ Page 1 of 1 (latest)

jade tinselBOT
#

👋 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/1337008097360744460

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

wary vault
#

Adding more context here, my requirement is:

#

When I click on a button "Continue with link" I want to display this:

#

When I click on continue without link, I want to display this:

merry basin
#

I am unable to display just the payment element
What do you mean by this exactly?

wary vault
#

When my page is loading, initially I am hiding Link. But still I am getting saved payment methods on my screen:

wary vault
#

I want this screen on load

#

Is that achievable?

#

I have a button called "Continue with link" only if user clicks on that, I should display the other screen

merry basin
wary vault
#

where do I pass this parameter? In PaymentElement?

#

options of PaymentElement I mean

merry basin
#

No, I am talking about your own variable which hides the LinkAuthenticationElement component. If the component is not rendered, you're not supposed to see the email field above the Payment Element

wary vault
#

I am using a state variable to handle this: {linkMode && ( <LinkAuthenticationElement id="link-authentication-element" onChange={handleLinkAuthenticationChange} options={{ defaultValues: { email: email } }} /> )}

#

linkMode is set to false by default

#

so it should not render right?

wary vault
#

But in my case, even when LinkAuthenticationElement is not rendering, I am able to see this saved methods

wary vault
#

Instead of this

jade tinselBOT
merry basin
# wary vault

This doesn't look right. What happens when you clear the email? Does the email field disappear?

You should be able to debug this by checking the source code of the page. Do you see the component being rendered when this is displayed?

wary vault
#

The LinkAuthenticationElement is not loading, but the PaymentElement loads this component automatically

#

As an alternative, is there any way for us to detect if the user is already having an active Link session?

#

does payment element return any info in any callbacks?

hallow sapphire
#

hi! I'm taking over this thread.

wary vault
#

Hey soma!

hallow sapphire
#

your goal is to programatically disable Link in the Payment Element?

wary vault
#

Yes. Dynamically enable/disable

#

I am able to hide the Link element dynamically, but when there is an active Link session, I am seeing the screen in above screenshot

#

If that is how it is expected to work, I would need to hide some of my components if there is an active session, But I don't see any way to detect it

#

I can give you more context if you need

hallow sapphire
#

do you have a link where we can reproduce the issue?

wary vault
#

ah unfortunately no it's my local :/

#

It would help if I know if there's a way to detect an active link session too

#

Does Payment element have any callback for that?

hallow sapphire
#

if there's a way to detect an active link session too
no that's not possible.

wary vault
#

Ah I see

#

Guess it happens internally in payment element

hallow sapphire
#

I think what you are trying to do is not possible. if you enabled Link on your Stripe account, and a user is already athenticated with Link, then it makes sense that the Payment Element will show the saved card of the customer