[w3c/webpayments-payment-apps-api] Payment apps and methods, are they the same? (#35)

I argue that `https://bobpay.xyz` can identify both a payment app and a payment method.

A payment app may live in `https://bobpay.xyz/sw.js` and may be described in `https://bobpay.xyz/payment-app.json`. The JSON file should contain the app's title and icons at the very least. This is also a good place to specify a list of all payment methods that this app supports.

A payment method may be defined in `https://bobpay.xyz/payment-method.json`. This JSON file should describe who is allowed to use this payment method. This can be either unrestricted or a whitelist of payment app identifiers, i.e., URLs.

Thus we have both a payment app and a payment method identified by `https://bobpay.xyz`. To make things slighly easier for ourselves, let's say that the payment app `https://bobpay.xyz` should always support the the `https://bobpay.xyz` payment method.

To be more concrete, let's take a look at an ecosystem of 3 payment methods and 3 payment apps.

### Payment methods
* `https://alicepay.xyz` is an unrestricted payment method, as specified in `https://alicepay.xyz/payment-method.json`:
```json
{
  "externally_supported_apps": ["*"]
}
```
* `https://bobpay.xyz` is a singleton payment method. Only one app is allowed to use it. This is specified in `https://bobpayx.xyz/payment-method.json`:
```json
{
  "externally_supported_apps": ["https://bobpay.xyz"]
}
```
* `https://charliepay.xyz` is a payment method that allows a whitelist of apps to use it. Specified in `htps://charliepay.xyz/payment-method.json`:
```json
{
  "externally_supported_apps": [
    "https://bobpay.xyz",
    "https://charliepay.xyz"
  ]
}
```

### Payment apps
* `https://alicepay.xyz` is a payment app that works with only one payment method. This is specified in `https://alicepay.xyz/payment-app.json`:
```js
{
  "name": "AlicePay"
  "icons": [],
  // Web payment extension.
  "payment_methods": ["https://alicepay.xyz"],
  "payment_app_service_worker": "/sw.js"
}
```
* `https://bobpay.xyz` is a payment app that works with all payment methods in this ecosystem. Specified in `https://bobpay.xyz/payment-app.json`:
```js
{
  "name": "BobPay"
  "icons": [],
  // Web payment extension.
  "payment_methods": [
    "https://alicepay.xyz",
    "https://bobpay.xyz",
    "https://charliepay.xyz"
  ],
  "payment_app_service_worker": "/sw.js"
}
```
* `https://charliepay.xyz` is a payment app that works with only two out of three payment methods, as specified in `https://charliepay.xyz/payment-app.json`:
```js
{
  "name": "CharliePay"
  "icons": [],
  // Web payment extension.
  "payment_methods": [
    "https://alicepay.xyz",
    "https://charliepay.xyz"
  ],
  "payment_app_service_worker": "/sw.js"
}
```

Exact fields are not set in stone. The manifests are based on [appmanifest](https://www.w3.org/TR/appmanifest/).

-- 
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/35

Received on Thursday, 8 September 2016 00:35:41 UTC