Re: [w3c/browser-payment-api] editorial: clarify that payment handler data is converted (#536)

For those watching at home, the following would be all fine: 

```JS
const methodData = [{
  // Must match "basic-card" spec, undergoes conversion
  supportedMethods: ["https://bank.com/any-type", "basic-card"],
  data: { supportedTypes: "visa" }
}, {
  // Must match "tokenized-thing" spec, undergoes conversion
  supportedMethods: ["tokenized-thing", "https://bit.com/coin", "https://bank.com/any-type"],
  data: { cryptoCurrencyThing: "thing" }
}, {
  // .data treated as a normal object, no dictionary conversion. 
  supportedMethods: ["https://foo.com/bar", https://bank.com/any-type"],
  data: { foo: "bar", "thumb": "drive", anything: "goes" }
}];
```

But:

```JS
const methodData = [
  // This would cause a rejection, iff "future-card" is supported:
  {
    supportedMethods: ["https://foo.com/future-card", "future-card"],
    data: { supportedTypes: ['THIS IS NOT A VALID VALUE!!'] }
  }, 
  // iff "future-card" is not supported, this one is still ok:
  {
    supportedMethods: ["https://foo.com/tokenized-thing", "tokenized-thing"],
    data: {   tokensAreFancy: true   }
  }, 
]
```


-- 
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/pull/536#issuecomment-303931015

Received on Thursday, 25 May 2017 06:06:57 UTC