[w3c/browser-payment-api] ShippingAddress versus Address (#189)

The currently defined ShippingAddress interface contains several fields that semantically line up with many of the fields in the Address interface (https://www.w3.org/TR/geolocation-API-v2/#address_interface); however, most such names are unnecessarily different (with the term "region" meaning radically different things between the two interfaces).

This will lead to unnecessary developer confusion.

One approach would be to have ShippingAddress inherit from Address, and then add the other fields that we decide we need. This has the effect of splitting the "streetnumber" field from the "street" field and of adding "county" and "premises" fields, but is otherwise consistent with what is currently defined:

```webidl
interface ShippingAddress : Address {
    readonly attribute FrozenArray<DOMString> additionalAddressLine;
    readonly attribute DOMString              dependentLocality;
    readonly attribute DOMString              sortingCode;
    readonly attribute DOMString              languageCode;
    readonly attribute DOMString              organization;
    readonly attribute DOMString              recipient;
};
```

Another approach would be to simply rename analogous fields to have identical names:
```webidl
interface ShippingAddress {
    readonly attribute DOMString              country;       /* was regionCode */
    readonly attribute FrozenArray<DOMString> addressLine;
    readonly attribute DOMString              region;        /* was administrativeArea */
    readonly attribute DOMString              city;          /* was locality */
    readonly attribute DOMString              dependentLocality;
    readonly attribute DOMString              postalCode;
    readonly attribute DOMString              sortingCode;
    readonly attribute DOMString              languageCode;
    readonly attribute DOMString              organization;
    readonly attribute DOMString              recipient;
};
```

Arguably, we could consider "organization" and "premises" to have sufficiently close meanings to consider them the same field, but I'd be curious to hear from others about whether that would serve their purposes.

---
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/browser-payment-api/issues/189

Received on Wednesday, 11 May 2016 14:02:27 UTC