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

Concretely, one sets the instrumentKey on an Instrument through the PaymentInstruments interface, so we will have to revisit that interface. Today it has these methods:
delete, get, keys, has, set, clear. How do these behave when an Instrument has a "default"
key in addition to its "otherwise" key? In particular, does keys() return the default key?

For example:

* delete(instrumentKey): works with all keys including default.
* get(instrumentKey): works on all keys including default
* has(instrumentKey): works on all keys including default
* set(instrumentKey, InstrumentDetails): works on all non-default keys
* setDefaultKey(instrumentKey,defaultKey): Makes the Instrument the default and assigns second key. 
* getDefaultKey(): returns defaultKey if specified, otherwise null
* keys(): works on all non-default keys. (I exclude the defaultKey so that you can do count(keys()) and determine the number of Instruments.
* clear(): works on all Instruments

Ian



-- 
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-308240961

Received on Tuesday, 13 June 2017 20:37:33 UTC