[w3c/payment-handler] Should PaymentInstruments.set() be immutable? (#285)

At the moment, [PaymentInstruments.set()](https://w3c.github.io/payment-handler/#dom-paymentinstruments-set) takes [PaymentInstrument](https://w3c.github.io/payment-handler/#dom-paymentinstrument) dictionary as  one of the parameters. `PaymentInstrument` has capabilities member of `object` type, therefore, it is possible to change capabilities before [PaymentInstruments.set()](https://w3c.github.io/payment-handler/#dom-paymentinstruments-set)  is completed.

```javascript
let capabilities = { supportedNetworks: ["visa"], supportedTypes: ["credit"] };
let promise = registration.paymentManager.instruments.set(
  "12345",
  {
    name: "Visa ****1111",
    icons: [{
      src: "/pay/visa.png",
      sizes: "32x32",
      type: "image/png",
    }],
    method: "basic-card",
    capabilities,
  });

capabilities.supportedNetworks = ["mastercard"];
```

I'm not sure whether this was discussed before or it is an intended behavior.

-- 
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-handler/issues/285

Received on Wednesday, 11 April 2018 12:44:47 UTC