#nikita-saboo_address-element-province-codes

1 messages ยท Page 1 of 1 (latest)

grand patrolBOT
#

๐Ÿ‘‹ 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.

frank fjord
knotty stone
#

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

frank fjord
#

That is not a "bug", it's the design of the object

knotty stone
#

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 ?

frank fjord
#

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

  1. Return the ISO code if the name is used
  2. If the Address Element is providing the code, return the code
knotty stone
#

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

frank fjord
#

Can you clarify the specific reason you need the ISO code?

knotty stone
#

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

frank fjord
#

Great, thanks. That helps me give the team the "why" so they can asses the level of effort and cost/benefit

knotty stone
#

Got it

frank fjord
#

Feedback filed

knotty stone
#

thank! is there a way to track it ?

frank fjord
#

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

knotty stone
#

ok thanks for the help

frank fjord
#

Happy to do it ๐Ÿ™‚