Re: [w3c/browser-payment-api] PaymentOptions seems overly verbose/overlaps with HTML (#326)

> There is no autofill field name for a full address.

Then we should add one to HTML... like "full-address" or whatever.   

> Another option could be to allow discrete address fields to be specified:

This is basically what we do today in forms: a "spray and pray" approach: where the developer requests the data (spray the names) in the hope (pray!) the user agent has it in it's autocomplete database.

That seems most sane, because a developer can't assume they will get anything back or what they will get back will be valid. It's flawed to assume otherwise (the current design just gives you back an empty string).  
 
Thus,  adding a generalized "address" auto fill keyword  would be good... but then having the rest is better: 
 
```Js
// I need these things to process the payment
const formFields = [
 "full-address", 
 "street-address",
 "address-level1", 
 "address-level2", 
 "country", 
 "postal-code",
];
```
Then the developer can pick through form data they get back.

```JS
async ()=>{
   const response = await new PaymentRequest(method, display, modz);
   // If we go with form data... 
   for (const [name, value] of response.entries()) {
      // rehydrate and validate form... 
  }   
}
```





-- 
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/326#issuecomment-263169426

Received on Monday, 28 November 2016 02:26:53 UTC