Re: [w3c/webpayments-payment-handler] Suggestion: replace `PaymentWallets` with a property on `PaymentInstrument` (#153)

This approach wouldn't necessarily make icons available for wallets, but they could be grouped under the same "name" which could be displayed:

```js
function addInstruments(registration) {
  const instrumentPromises = [
    registration.paymentManager.instruments.set(
      "dc2de27a-ca5e-4fbd-883e-b6ded6c69d4f",
      {
        name: "Visa ending ****4756",
        enabledMethods: ["basic-card"],
        capabilities: {
          supportedNetworks: ['visa'],
          supportedTypes: ['credit']
        },
        group: "Acme Bank Personal Accounts"
      }),

    registration.paymentManager.instruments.set(
      "c8126178-3bba-4d09-8f00-0771bcfd3b11",
      {
        name: "My Bob Pay Account: john@example.com",
        enabledMethods: ["https://bobpay.com/"],
        group: "Acme Bank Personal Accounts"
      }),

    registration.paymentManager.instruments.set(
      "new-card",
      {
        name: "Add new credit/debit card to ExampleApp",
        enabledMethods: ["basic-card"],
        capabilities: {
          supportedNetworks:
            ['visa','mastercard','amex','discover'],
          supportedTypes: ['credit','debit','prepaid']
        },
        group: "Acme Bank Personal Accounts"
      })
    ];

    return Promise.all(instrumentPromises);
  }
```

Just floating this as a lighter weight approach to getting grouping into the spec if the heavier weight `PaymentWallets` approach seems unlikely to get implemented.

-- 
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-handler/issues/153#issuecomment-300347764

Received on Wednesday, 10 May 2017 01:28:58 UTC