#maxwell-paymentelement-email

1 messages ยท Page 1 of 1 (latest)

dapper crystalBOT
winter leaf
dapper crystalBOT
neat fractal
#

Thanks for your reply. If I use my own text field how would I add data validation so the the email field is consistent with the rest of the form?

compact cargo
#

maxwell-paymentelement-email

#

@neat fractal if you do your own field you would do your own validation

neat fractal
#

Trying to accurately mimic Stripe's validation styling that is in the rest of the form doesn't seem like a realistic approach. What alternatives are there? Collecting an email address along with a shipping address and payment details should be an extremely common use case, it feels like there should be a supported way to do this?

compact cargo
#

Sure but there isn't right now

#

It's something we want to offer in the future, just hasn't been built yet

neat fractal
#

So what are my options? Meticuously recreating stripes validation styling for an email text input is not realistic. Is there really not not a way I can force stripe to add an email field? The only solution I can think of is using the prebuilt checkout, but it doesn't fit my usecase.

compact cargo
#

I'm sorry I don't understand what you call "recreating stripes validation styling". It's an email field, you control it, you can style it the same way you style the rest of PaymentElement

neat fractal
#

For example, if you enter a card number with the incorrect number of digits, red text and a little red icon will appear telling you what is wrong. I would need to recreate that for the email field to validate it is in the correct format, eg contains an @ symbol etc.

compact cargo
#

Gotcha, then yes you have to do that yourself

neat fractal
#

Like I said before, that's not a realistic approach, what other options do I have?

compact cargo
#

That is the only option, that's what everyone else does

neat fractal
#

I don't believe that is true, that kind of approach is considered really bad practice for software development. Do you have any colleagues who might have some ideas?

compact cargo
#

There is no other solution. You already talked to a colleague of mine. I also just asked the lead on my team who said the exact same thing. You have to build this yourself

neat fractal
compact cargo
#

which part? It's a 9 minutes video

neat fractal
#

right at the beginning (about 10 seconds in) they show a checkout form using custom elements which has an email field.

compact cargo
#

ah cool, you had linked to almost the end of the video

#

but yeah this is basically their own email field really

neat fractal
#

sorry

compact cargo
#

look at 1:02

#

I think it's the LinkAuthenticationElement

#

and it's unlikely to be what you want ๐Ÿ˜ฆ

neat fractal
#

Ah, ok yeah I just saw that it is using Link. Can link just be used to collect an email address or does the user have to sign up for Link? I'm thinking using Link is a better option than having to code my own email element.

compact cargo
#

It's specific to Link and not really relevant in PaymentElement because we're embedding this for you for Link but only for customers who want to use Link
So really I would still say my answer is exactly the same as earlier. I know you don't want this answer but sadly this is the way today

neat fractal
#

Ok, thanks for your help. Given it is all open source I'm going to see if I can find the styling and validation code so I can just copy it.

dapper crystalBOT
compact cargo
#

I did push for your feature request internally. My team has asked for it a lot because you're definitely not the only person who wants this