- From: Marcos Cáceres <notifications@github.com>
- Date: Tue, 25 Jul 2017 02:00:32 -0700
- To: w3c/payment-handler <payment-handler@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Tuesday, 25 July 2017 09:01:15 UTC
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