Re: [w3c/webpayments-payment-apps-api] Payment app identifier to manifest filename mapping (#48)

I am reminded from the email thread on this topic of a 3rd option which is:

1. The Payment App Identifier is the service worker scope (e.g. `http://bobpay.com/paymentapp/v1`)
2. There is a payment app manifest file at the **SAME** url

The manifest file would follow the format defined by https://github.com/w3c/manifest/ and can therefor specify the URL of the service worker script (per https://github.com/w3c/manifest/pull/507).

Therefor the response to a GET of `http://bobpay.com/paymentapp/v1` would return something like:
```
{
  "lang": "en",
  "dir": "ltr",
  "name": "BobPay v1.0",
  "description": "The best way to pay!",
  "short_name": "bobpayv1",
  "scope": "/",
  "icons": [{
    "src": "icon/lowres.webp",
    "sizes": "64x64",
    "type": "image/webp"
  },{
    "src": "icon/lowres.png",
    "sizes": "64x64"
  }, {
    "src": "icon/hd_hi",
    "sizes": "128x128"
  }],
  "serviceworker": {
    "src": "sw.js",
    "scope": "/",
    "use_cache": false
  }
}}
```
Note:
  * We'd likely need to restrict the allowed values for "scope" since we are explicitly saying already that the scope is `http://bobpay.com/paymentapp/v1`. Either the browser can pre-validate the manifest with some payment app manifest specific logic OR simply ignore the provided value when processing a manifest in the context of registering a payment app.
  * Both the app and the service worker have a scope defined in the manifest file. We'd probably want these to be the same and restricted per point above.
  * There are some manifest attributes (like `start_url` that make no sense for payment apps so we'd likely say that these are ignored (which the mnaifest spec already allows for).

Looking forward to the proposal from @marcoscaceres!

-- 
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/48#issuecomment-274080794

Received on Friday, 20 January 2017 14:12:15 UTC