Re: [w3c/browser-payment-api] Currency Types and Rendering (#185)

@rsolomakhin - this is an interesting idea and might be a good way of thinking about this because it allows the app to present it's installed "instruments" to the browser during app registration which allows the browser to show these to the user before the app is invoked.

i.e. The user knows before picking the app which payment instrument they will use (less chance of picking an app and then realising you wanted to use your XYZ card but that's stored in another app etc) but doesn't leak any data to the website.

If you look at the PaymentApps proposal there is a proposed format for app data during registration that includes things like the app name, the URL used to invoke the app etc.

I can imagine that we could change the `enabled_methods` property to take a sequence of PaymentInstrument objects defined like this:

```
dictionary PaymentInstrument {
    required sequence<DOMString> supported_methods;
    required DOMString name;
    required URLString icon_url;
};

dictionary PaymentApp {
    required URLString start_url;
    required sequence<PaymentInstrument> payment_instruments;
}  
```
So registering an app would look something like:

```javascript
navigator.payments.registerPaymentApp({
  start_url: "https://app3.com/payment_app/endpoint",
  payment_instruments: [
    {
      supported_methods: ["bitcoin"],
      name: "Bitcoin Wallet in App 3",
      icon_url: "https://app3.com/payment_app/bitcoin_icon.svg"
    },
    {
      supported_methods: ["debit-card"],
      name: "Debit Card Y in App 3",
      icon_url: "https://app3.com/payment_app/debit_icon.svg"
    },
  ]
});
```


---
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/browser-payment-api/issues/185#issuecomment-223296662

Received on Thursday, 2 June 2016 13:48:48 UTC