#nikita-saboo_address-element-province-codes
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/1314279048385663067
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'm not sure what you are referring to here. We return an object as we describe here: https://docs.stripe.com/js/elements_object/get_value_address_element
yes that object has a state field
that is literal name instead of code for a lot of countries
We need to get the exact State code instead of the State name
because for USA and Canada the object.value.state has the right state code. This is inconsistent across different countries
That is not a "bug", it's the design of the object
Since we are trying to use address element to get the address from user, we specifically need a state standard iso-code. How do you suggest we circumvent this problem ?
First: I will file a feature request to use the ISO 3166-2 spec. I cannot guarantee this will get picked up but I can at least make sure the engineering team for the Address Element is aware of your interest.
Second: I recommend, for the near term, you create a map of full names to codes and write an algorithm to
- Return the ISO code if the name is used
- If the Address Element is providing the code, return the code
Thanks for the feature request. How can I track it ?
I was trying to avoid a map for this but looks like the only solution here
Can you clarify the specific reason you need the ISO code?
We use Avalara and Taxamo apis for taxes, they expect a code. We have been using codes without the addressElement with Stripe Payment Element. We are trying to adopt AddressElement for a cleaner UI
Great, thanks. That helps me give the team the "why" so they can asses the level of effort and cost/benefit
Got it
Feedback filed
thank! is there a way to track it ?
I recommend you write in to Support here: https://support.stripe.com/contact
and request to be kept informed.
They will be able to find the internal ticket and track any updates
ok thanks for the help
Happy to do it ๐