W3C home > Mailing lists > Public > public-payments-wg@w3.org > February 2016

Re: [webpayments] PROPOSAL: Pass the list of supported payment methods and the method-specific data in a single object (#77)

From: Rouslan Solomakhin <notifications@github.com>
Date: Wed, 03 Feb 2016 14:25:14 -0800
To: w3c/webpayments <webpayments@noreply.github.com>
Cc: webpayments <public-payments-wg@w3.org>
Message-ID: <w3c/webpayments/issues/77/179503870@github.com>
Correct me if I am wrong, I am seeing three options available here. Based on my dreamt up examples below, all of these options are fairly close to each other. Perhaps Option 1 is still the cleanest, which will be easier to describe in the spec and tutorials. So I would prefer the simpler Option 1, although I am largely flexible on this question.

Option 1. 
````json
var paymentMethods = ["method1", "method2", "method3"];
var paymentMethodDetails = {
  "method1": {"field1": "value1", "field2": "value2"},
  "method2": {"field3": "value3", "field2": "value2"}
};
````
Option 2.
````json
var paymentMethods = [{
  "methods": ["method1", "method2"],
  "data": {"field2": "value2"}
}, {
  "methods": ["method1"],
  "data": {"field1": "value1"}
}, {
  "methods": ["method2"],
  "data": {"field3": "value3"}
}];
````
Option 3.
````json
var paymentMethods = [{
    "method": "method1",
    "data": {"field1": "value1", "field2": "value2"},
  },  {
    "method": "method2",
    "data": {"field3": "value3", "field2": "value2"},
  },  {
    "method": "method3"
}];
````

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webpayments/issues/77#issuecomment-179503870
Received on Wednesday, 3 February 2016 22:25:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:43:14 UTC