Re: [w3c/webpayments-methods-card] Behavior when method-specific data is invalid (#20)

I propose we update the basic-card spec like with this phrasing:

> If `supportedMethods` contains `"basic-card"` and `data` is not in correct format, then user agent **MAY** throw `TypeError`.

For PaymentRequest spec:

> If `data` format does not match the specification of its `supportedMethods`, then user agent **MAY** throw `TypeError`.

I'm using **MAY** instead of **MUST** because throwing works only for built-in payment methods, where user agent knows the format beforehand. Today that's `"basic-card"` and `"https://android.com/pay"` for Chrome, for example. However, when we have payment apps like `"https://samsung.com/pay"` or `"https://alipay.com"`, then the user agent will not know the right format of `data`, so it cannot throw in constructor. It can, however, reject the `show()` promise in that case.

-- 
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/webpayments-methods-card/issues/20#issuecomment-264458016

Received on Friday, 2 December 2016 13:52:14 UTC