contact-picker icon indicating copy to clipboard operation
contact-picker copied to clipboard

Matching ContactAddress fields to autofill attributes

Open jcayzac opened this issue 5 years ago • 8 comments

Hi,

There is no clear mapping between the fields of PaymentAddress and the values accepted by the autocomplete attribute for shipping and billing addresses: PaymentAddress uses descriptive semantics while autocomplete leaves the semantics open to regional variations. Is there a suggested mapping between the two?

Thank you.

jcayzac avatar Oct 16 '20 00:10 jcayzac

@marcoscaceres, @danyao, @rsolomakhin, @romandev, @aestes comments welcome!

ianbjacobs avatar Oct 16 '20 15:10 ianbjacobs

From the top of my head:

PaymentAddress Autocomplete
recipient name
organization organization
addressLine street-address
dependentLocality address-level3
city address-level2
region address-level1
country country
postalCode postal-code
sortingCode postal-code
phone tel

There's no separate field for sortingCode in autocomplete. The postal-code field is reused with a note:

Postal code, post code, ZIP code, CEDEX code (if CEDEX, append "CEDEX", and the arrondissement, if relevant, to the address-level2 field)

CEDEX is one type of sorting code. It may be the only type. I'm not 100% certain.

rsolomakhin avatar Oct 16 '20 17:10 rsolomakhin

@rsolomakhin Thank you very much!

Maybe this could be mentioned in a non-normative section of the spec.

jcayzac avatar Oct 17 '20 00:10 jcayzac

There's no separate field for sortingCode in autocomplete. The postal-code field is reused with a note:

Postal code, post code, ZIP code, CEDEX code (if CEDEX, append "CEDEX", and the arrondissement, if relevant, to the address-level2 field)

Just a small correction: the note actually says the address-level2 field is reused, not the postal-code field.

Thanks!

jcayzac avatar Oct 17 '20 01:10 jcayzac

As you said, autocomplete in the HTML spec varies by region so the mapping also varies by region. There isn't a single global mapping e.g. address-level1 could be a region or city, address-level2 could also be a (sub)-region or city, etc.

mnoorenberghe avatar Oct 18 '20 22:10 mnoorenberghe

Yeah…

In the context of a PWA using the Payment Handler API, the address input may rely on web forms annotated with autocomplete=address-level3 etc…

Now, I am assuming that the reasoning behind fixing semantics in PaymentAddress is that since it is being consumed by a merchant it should not depend on either the locale of the end-user nor the region of the payment handler, which kind of makes sense. So, it's up to the payment handler to "standardize" the address and produce a locale-invariant one.

(That the Contact Picker API reuses PaymentAddress, OTOH, really doesn't make much sense to me to be honest. But I guess that's an issue for another working group 😉 )

jcayzac avatar Oct 19 '20 10:10 jcayzac

Noting duplicate of w3c/payment-request#505.

marcoscaceres avatar Feb 18 '21 05:02 marcoscaceres

This issue was raised in Payment Request, but closed once we removed addresses from that API. Since the features are now part of Contact Picker, we are transferring the issue here.

ianbjacobs avatar Feb 12 '24 18:02 ianbjacobs