[w3c/payment-request] PaymentAddress 'region' inconsistencies (#663)

I'm having a number of issues integrating our checkout with the payment request API when it comes to shipping options / shipping address forms. These centre around the address 'region', e.g. 'CA' in the US. 

**Project info / requirement**
To give some background, I have a requirement to have shipping options that are available to certain regions within a country. This could be for legal reasons, e.g. in the US, only being able to ship certain goods to certain states. I must therefore, verify user inputted address region values against our shipping options when determining which shipping options to pass to the payment request interface.

**Lack of 'region' input**
Depending on the country however, sometimes the region is mandatory (US, Australia), optional (Ireland), missing (Qatar). Can this field be mandatory for all countries? (i.e. we would need 'region' to be mandatory in all cases so we can verify our shipping options against the user's country and state)

**Inconsistency of input type and value**
For both address forms that could be used, i.e. billing and shipping, the value retrieved from the user is not in a consistent format, in terms of input type and response value. On web browsers (as far as I've tested), the region is a dropdown. However, depending on the country, the value returned is not consistent, e.g. it's a 2 letter code such as 'CA' for the US, state name such as 'Delhi' for India, and 'Co. Dublin' for Ireland. 

On mobile browsers (and possibly some web, but generally mobile), the 'region' is a free form input, so the customer could enter anything essentially, e.g. 'CA', 'California', 'Californnn'. In this case, we have no direct solution for mapping this value.

**Overall solution proposal**
- 'Region' is mandatory.
- 'Region' returns the state as a 2 letter code (ISO 3166-2), from a pre-defined set of values.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/663

Received on Friday, 15 December 2017 15:20:13 UTC