Re: [w3c/payment-method-basic-card] Unclear what happens when there are duplicates? (#36)

Maybe I am misunderstanding but the sheet doesn't show items from this list. 

The browser uses this list to establish the set of supported methods (and possibly filters for those methods) from the merchant. It compares that to the set of supported methods from all payment handlers (including the built-in `basic-card` handler) and shows a list of payment handlers (and possibly instruments) that can be used.

What is not clear is, if there is a payment method with filters (e.g. `supportedTypes: ["debit"]`) but another with the same identifier and no filters (implying all types are supported in this case) does that mean the filters are ignored.

If so, the example you provide above should be equivalent to:

```javascript
new PaymentRequest(
  [
    {
      supportedMethods: "basic-card",
    }
  ],
  details
);
```

..because when the browser gets to that tuple it will match on all handlers that handle `basic-card`.

So I think @zkoch is correct that the browser does nothing special for duplicates.

In fact, I think it is important that it does behave as currently written because a merchant may wish to use a request like this:

```javascript
new PaymentRequest(
  [
    {
      supportedMethods: "basic-card",
      data: {
        supportedTypes: ["debit"],
        supportedNetworks: ["visa", "amex"],
      }
    },
    {
      supportedMethods: "basic-card",
      data: {
         supportedTypes: ["credit"],
      }
    },
  ],
  details
);
```
...implying, I accept credit cards from all networks but debit cards only from VISA and Mastercard.

-- 
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/payment-method-basic-card/issues/36#issuecomment-318047751

Received on Wednesday, 26 July 2017 13:08:10 UTC