Re: [w3c/payment-handler] Ability to set default instrument for given handler (#173)

Hhmmm... this can be simplified a lot... Maybe: 

```
interface PaymentInstruments {
    Promise<boolean>             delete(DOMString instrumentKey);
    Promise<PaymentInstrument>   get(DOMString instrumentKey);
    Promise<sequence<DOMString>> keys();
    Promise<boolean>             has(DOMString instrumentKey);
    // Just put the id on the `details`
    // 🚨 Also, this has to return itself - like .set() in a JS Set()  
    Promise<PaymentInstruments>                set(PaymentInstrument details);
    Promise<PaymentInstrument>                setDefault(DOMString instrumentKey);
    Promise<void>                clear();
};
```

Also, please see how to wire this up to be an async generator with:

```JS 
for async (const instruments of navigator.paymentInstruments){
    // THIS HAS TO WORK
}
```


-- 
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/173#issuecomment-317675297

Received on Tuesday, 25 July 2017 09:01:15 UTC