#vipul_13860
1 messages · Page 1 of 1 (latest)
Can you share the code you're using?
i have custom email already with me, so i dont want to customer change email on checkout
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,
}}
/>
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
even if i not use linkauth element
paymentElement also gives ability to update email
one sec i ma sending screenshot
Yeah I mean to be clear the email field there is specific to Link authentication
this is the first screen coming when i pass email prefilled
It has nothing to do with the associated payment. If you want to use the email you're pre-collecting for the payment you'd pass it to confirmPayment: https://stripe.com/docs/js/payment_intents/confirm_payment#confirm_payment_intent-options-confirmParams
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
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
Yep should do
but i am assuming that in that case two email filed will come, may be little bit confusing for users
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
yes i undetstand that, but if it show two email filed it create confusion
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
okay thank you