#KuVana
1 messages · Page 1 of 1 (latest)
Hi, this is the integration guide, https://stripe.com/docs/payments/link/accept-a-payment?platform=web&ui=elements for Link. Can you share the exact issues you're seeing with more details?
I am using my own email field and passing the value to the PaymentElement. But I'm not seeing the Link integration
Does Link not work with the deferred paymentIntent?
https://stripe.com/docs/payments/accept-a-payment-deferred?type=payment
Let me try to test this on my end
thank you
You said you already have a Link account? Did you disabled Link on your account?
Link is enabled in the Payment Methods in stripe. My email does not have a Link account, however, I do see the link element when using the LinkAuthenticationElement just not when I pass the email from my own email field
What does from my own email field mean?
Like is this your own hmtl input you're talking about?
Yes, own html input. I was following the "Pass email to the PaymentElement" method
https://stripe.com/docs/payments/link/alternative-integration
Ok, I'm confirming this on my end. Thank you for your patience.
No worries, thanks for your time. If I have to use the LinkAuthenticationElement that's fine. I would just need some help styling it like our other text fields. I'm working through the Appearance API, but it seems there are some missing options
@final aspen sorry I've never used that "alternative integration" before. Can you confirm that if you create a PaymentIntent right now on your account you get link in the list of payment_method_types?
If you have a clear PaymentIntent id pi_123 I can look too
I am. It renders when I use the LinkAuthenticationElement just not when I use my own input field and pass the value to the PaymentElement
I see, let me try that flow and see what it's about 😅
So just to make sure, you're saying that you are initializing Elements without a client secret, like with a specific amount/currency, you see Link but as soon as you pass defaultValues: { billingDetails: { email: 'jamie@example.com', }, }, it disappears?
like right now when I initialize PaymentElement with const options = { mode: 'payment', amount: 2099, currency: 'usd', }; const stripe = Stripe('pk_test_123'); var elements = stripe.elements(options); const paymentElement = elements.create('payment'); paymentElement.mount('#payment-element'); I see this
No,
I am initializing Elements without a client secret with the amount. I enter the email in my field, and when the PaymentElement renders, it does not display the link at all.
It only displays Link in the PaymentElement if I use the LinkAuthenticationElement instead of my own email field.
Let me try creating the payment element with the mount function. I'm just using the React element, not mounting it with create
sorry I don't follow. My example is what you described right? I initialize PaymentElement without a client secret and with an amount/currency specifically
so I'm asking if that shows Link for you
It doesn't show
Can you try the API key pk_test_TYooMQauvdEDq54NiTphI7jx and see if it shows?
it's our default key from our docs and it shows for me
(no email pre-fill, nothing, just my basic example code)
Because if I pass defaultValues: { billingDetails: { email: 'jamie@example.com', }, }, like the docs say, what the UI does is think "okay we don't have a Link account with that email so we won't ask them for their email to see, we assume they don't. And at the bottom we offer "sign up for Link" like the pictures below
Similarly if I pass an email associated with a Link account on my account in Test mode like lol@lol.com for me I see the authentication flow:
It's still not working with the test key. :/ or if I pass an email directly into the element
<PaymentElement
onChange={handlePaymentChange}
options={{
defaultValues: {
billingDetails: {
email: 'lol@lol.com',
}
}
}}
/>
It's alright, I'll just use the Link Element and work on styling it properly
lol@lol.com is only if you have already signed up for Link in Test mode on that specific account
that's why the pictures I shared showed you the different state
I assume you see