#kevinrr_unexpected
1 messages ยท Page 1 of 1 (latest)
๐ 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/1367280210050945135
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
we have a custom form hosted on stripe already. but we want to add an extra field (credit card nickname) which is why we are creating a custom form. the stripe hosted form looks like the screenshot below:
our custom form looks like this:
Hi! So the Address Element is designed to do address lookup via Address line 1 - that's really the upside to that vs. your own fields. I don't see a way to remove pieces of it unfortunately.
i see, thank you. is there a way to get the zip code field to show up without specifying a default value?
we have this which makes it show. but if i replace postal_code: "-" with an empty string or even remove it, only Address Line 1 shows up
<AddressElement
options={{
mode: "billing",
fields: {
phone: "never",
},
defaultValues: {
address: {
postal_code: "-",
country: "US",
},
},
}}
/>
That's because Address Line 1 is an address search box that the user can use to find their address - which is where one would start with an approach like that.
If all you need is country and ZIP, you're going to have to build your own thing to do that.
ah gotcha, thank you ๐
appreciate your time! i have a direction now
actually, one more question. does stripe need the country and zipcode for a card to be added?
if it's not needed, then i dont think we need AddressElement after all
It's not needed, but it can make a big difference.
Why are you collecting the address? And why only country & zip/postcode?
im not sure, right now our startup only operates in the US but could possibly expand to other countries
we dont use the country and zipcode info right now
those fields exist on our stripe hosted form, which is why i was under the impression they were needed
Collecting the billing address is very helpful in terms of increasing the probability of success for any given charge, so there's no technical downside to collecting it, assuming it doesn't bother your users.