Re: [w3c/browser-payment-api] Should it be possible to vary amounts depending on payment method (#4)

> The solution is simply to allow an amount for each PaymentMethod (in exactly the same format as the amount specified in details.amount).

One of the hard lessons we learned from the RDFa and Microdata standardization effort was that people (developers) have a hard time keeping state information in their head. If your data structure requires the developer to understand some sort of state machine (and the transitions that the state machine can go through), that can lead to errors. 

Your proposal, @adrianhopebailie, has a light-touch state machine in it. That is, read the amount at the top level, and then override if a particular payment method has an amount field. While that seems simple, it's more complexity than may be necessary. We could just specify the amount on a per-payment method basis. The downside to this approach is that you repeat the amount. That said, I don't think that repetition is that terrible and it removes the need to understand that the data structure is is interpreted by a state machine.

So, -0.5 for specifying amount at the top of the data structure and overriding it in each payment method set.

+0.5 for repeating the amount information in each payment method block.

---
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/4#issuecomment-221912635

Received on Thursday, 26 May 2016 15:53:18 UTC