Re: [w3c/payment-request] Adding support for private-label credit cards (#662)

So, as I'm spec'ing this out, I realized that it might be more consistent to put a nullable `paymentMethod` attribute on `PaymentRequest`. 

So:

```JS
partial interface PaymentRequest {
    readonly attribute PaymentMethod? paymentMethod;
    attribute EventHandler onpaymentmethodchanged;
};

interface PaymentMethod {
  readonly attribute USVString methodName;
  object details; // payment method specific
};
```

And so:

```js
request.onpaymentmethodchanged = ev => {
   const { paymentMethod } = ev.target;
   // recalculate based on either methodName and/or on the details
   const newTotal = recalculateCosts(paymentMethod);
   ev.updateWith({ total: newTotal });
}
```


-- 
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/payment-request/issues/662#issuecomment-375550711

Received on Friday, 23 March 2018 05:39:08 UTC