Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matching ContactAddress fields to autofill attributes #71

Open
jcayzac opened this issue Oct 16, 2020 · 8 comments · Fixed by w3c/payment-request#955
Open

Matching ContactAddress fields to autofill attributes #71

jcayzac opened this issue Oct 16, 2020 · 8 comments · Fixed by w3c/payment-request#955

Comments

@jcayzac
Copy link
Member

jcayzac commented Oct 16, 2020

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.

@ianbjacobs
Copy link

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

@rsolomakhin
Copy link

rsolomakhin commented Oct 16, 2020

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.

@jcayzac
Copy link
Member Author

jcayzac commented Oct 17, 2020

@rsolomakhin Thank you very much!

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

@jcayzac
Copy link
Member Author

jcayzac commented Oct 17, 2020

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!

@mnoorenberghe
Copy link
Member

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.

@jcayzac
Copy link
Member Author

jcayzac commented Oct 19, 2020

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 😉 )

@marcoscaceres
Copy link
Member

Noting duplicate of w3c/payment-request#505.

@ianbjacobs
Copy link

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 ianbjacobs reopened this Feb 12, 2024
@ianbjacobs ianbjacobs changed the title Matching PaymentAddress fields to autofill attributes Matching ContactAddress fields to autofill attributes Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants