#vipul_13860

1 messages · Page 1 of 1 (latest)

sharp heartBOT
south lintel
#

Can you share the code you're using?

kind sedge
#

i have custom email already with me, so i dont want to customer change email on checkout

south lintel
#

Just the relevent Payment Element part would be good!

#

I can't expand it all

kind sedge
#

okay

#

i am sending

#

const paymentDefaultValues = {
billingDetails: {
email: user?.email,
name: user?.firstname,
// phone: "888-888-8888",
// address: {
// postal_code: "10001",
// country: "US",
// },
},
};
<LinkAuthenticationElement id="link-authentication-element" />
<AddressElement
options={{
mode: "billing",
defaultValues: {
name: user?.firstname,
},
display: {
name: "full",
},
}}
<PaymentElement
id="payment-element"
options={{
defaultValues: paymentDefaultValues,
}}
/>

south lintel
#

It'll be because you're using <LinkAuthenticationElement /> component, that allows the user to provide an email address but prefills with the default value you're providing

#

AFAIK you can't prevent that, but checking

kind sedge
#

even if i not use linkauth element

#

paymentElement also gives ability to update email

#

one sec i ma sending screenshot

south lintel
#

Yeah I mean to be clear the email field there is specific to Link authentication

kind sedge
#

this is the first screen coming when i pass email prefilled

south lintel
#

Yeah this is specifically for enabling customers to sign in with Link as I said.

#

It's not for collecting an email for the payment itself

kind sedge
#

not i am able to update

#

but can you guide me i can show email address of user in disabled condition stilll can use link in payment element

south lintel
#

As I stated, that is not supported

#

You'd need to use your own form field for that

kind sedge
#

okay but in that case still link work as it is ?

#

if i passed that to payment element

south lintel
#

Yep should do

kind sedge
#

but i am assuming that in that case two email filed will come, may be little bit confusing for users

south lintel
#

The reason it isn't disabled is the customer might have Link account with a different email to the one they're using in your checkout flow and they want to authenticate with that

kind sedge
#

yes i undetstand that, but if it show two email filed it create confusion

south lintel
#

I've already explained to you how you can pass the existing email you have for associated to the payment

#

The field you're using right now cannot be disabled, but is prefilled with the email you're got on file

kind sedge
#

okay thank you