Re: [w3c/webpayments-payment-apps-api] `appRequest` attribute should not be a dictionary (#111)

@marcoscaceres --
> Sorry, I'm still confused. To which member or attribute does it map in Payment Request?

It doesn't. This is part of what we've been trying to explain with regards to it necessarily being a different object type than the `PaymentRequest`: it's not a subset of the data in `PaymentRequest`, nor is it a superset. It necessarily lacks some items that appear in `PaymentRequest` (such as line items), and it necessarily has some items that cannot appear in `PaymentRequest`, such as `implementId`.

So, let me try again to explain what the `implementId` in `PaymentAppRequest` means. Let's look at this example:

![amex](https://cloud.githubusercontent.com/assets/2974852/24127575/9d667b5a-0da3-11e7-820a-071af8f188ee.png)

There are three wallets registered: two on www.americanexpress.com, and one on Bank of America's origin (they have an EV cert, so they get a name rather than a domain displayed in my example, but I'll note this is non-normative). When www.americanexpress.com added the "Account ending in 9004", they did so with something like the following:

```javascript
    registration.paymentManager.instruments.set(
      "dc2de27a-ca5e-4fbd-883e-b6ded6c69d4f", // This is the implementId
      {
        name: "Account ending in 9004",
        enabledMethods: ["basic-card"],
        capabilities: {
          supportedNetworks: ['amex'],
          supportedTypes: ['credit']
        }
      }),
```

They would have registered the other payment instruments ("Account ending in 7195" and "Account ending in 3015") similarly, although the first parameter to "set" would have been different.

That first parameter, that key, is the `instrumentId`.

So, when I, as a user, click on the "Account ending in 9004" option, we're going to pass that information (`dc2de27a-ca5e-4fbd-883e-b6ded6c69d4f`) along to the service worker that is handling the event. We will call it instrumentId. And this will let it know that I have indicated a desire to use *that* card -- rather than the other two it knows about -- so that it doesn't have to ask me again.

-- 
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/111#issuecomment-287942688

Received on Tuesday, 21 March 2017 00:44:47 UTC