[w3c/webpayments-payment-apps-api] Replace setManifest()/getManifest() with set()/get()/keys()/has()/delete() (#95)

When a payment app is being set up in the current spec, it does so by (a) registering as a service worker, and then (b) installing a monolithic object via `PaymentAppManager.setManifest()`. Subsequent updates are performed through calling `PaymentAppManager.getManifest()`, mutating the object, and setting it again.

@marcoscaceres has proposed that this be replaced with a decomposed interface that allows for payment apps to modify their characteristics on a more granular level using get/set/delete/etc. operations.

As a slight modification of the proposal he made in his payment-request-handler document, I propose concretely:

1. Removing the `setManifest()` and `setManifest()` methods from `PaymentAppManager`.
2. Adding new `setName()` and `setIcon()` methods to `PaymentAppManager`.
3. Adding a new `options` attribute to `PaymentAppManager`, of type `PaymentMethodOption`, having the following definition (taken from Marcos' proposal):

```webidl
[Exposed=(Window,Worker)]
interface PaymentMethodOptions {
    [NewObject]
    Promise<boolean>              delete(DOMString methodKey);
    [NewObject]
    Promise<PaymentMethodDetails> get(DOMString methodKey);
    [NewObject]
    Promise<sequence<DOMString>>  keys();
    [NewObject]
    Promise<boolean>              has(DOMString methodKey);
    [NewObject]
    Promise<void>                 set(DOMString methodKey,
                                                      PaymentMethodDetails details);
};
```

-- 
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/webpayments-payment-apps-api/issues/95

Received on Monday, 23 January 2017 22:29:32 UTC