Closed Bug 1376623 Opened 7 years ago Closed 7 years ago

PaymentMethodData.supportedMethods is now DOMString

Categories

(Core :: DOM: Web Payments, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: marcosc, Assigned: edenchuang)

References

()

Details

(Keywords: dev-doc-complete, Whiteboard: [WP-MVP][M4])

Attachments

(1 file)

We changed the spec to now use a DOMString.
Blocks: 1318987
Assignee: nobody → echuang
Attachment #8882610 - Flags: review?(amarchesini) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/0c719d83c30b
PaymentMethodData.supportedMethods is now DOMString. r=baku
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0c719d83c30b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
This is already documented here:

https://developer.mozilla.org/en-US/docs/Web/API/PaymentRequest/PaymentRequest

But I'm a little confused - a sequence of DOMStrings seems programmatically more useful than a single DOMString, so why change it? Do we only allow one card to be input at a time, or will the DOMString contains more than one payment method at once?

I've tried updating the parameter description, but I am pretty the example is now wrong and needs to be changed. Can I have a quick tech review before I do anything else?

Thanks.
Flags: needinfo?(mcaceres)
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #5)
> This is already documented here:
> 
> https://developer.mozilla.org/en-US/docs/Web/API/PaymentRequest/
> PaymentRequest
>
> I've tried updating the parameter description, but I am pretty the example
> is now wrong and needs to be changed. Can I have a quick tech review before
> I do anything else?

Correction as below. Let me know for any question.

[Parameters]
1) methodData.supportedMethods -
   "... it is a single DOMString, and the meaning of the data parameter changes with the supportedMethod."
   => should be supportedMethod's' (I know it's confusing. Please refer to [1])
2) methodData.data.supportedNetworks -
   "This property is required if the supportedMethods property is 'basic-card'."
   => the property is optional per NOTE in [2]
3) options => Lets instead of Let's

[Examples]
4) supportedMethods usage should be revised as your 'Chrome 57 later' example. Check [3] for examples in current spec.
5) The total amount 55 is less than displayItems amount 65, though possible [4] but weird.
6) nit: the indention of var supportedInstruments, details and options should be the same level.


---

[1] https://github.com/w3c/browser-payment-api/issues/549#issuecomment-314236618
[2] https://www.w3.org/TR/payment-method-basic-card/#basiccardrequest
    "The supportedNetworks and supportedTypes fields are both optional. If neither is provided then any card may be returned."
[3] https://www.w3.org/TR/payment-request/#examples-of-usage
[4] https://www.w3.org/TR/payment-request/#dom-paymentdetailsbase-displayitems
    "It is the developer's responsibility to verify that the total amount is the sum of these items. "
Flags: needinfo?(mcaceres)
(In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #5)
> But I'm a little confused - a sequence of DOMStrings seems programmatically
> more useful than a single DOMString, so why change it? Do we only allow one
> card to be input at a time, or will the DOMString contains more than one
> payment method at once?

Please refer to discussions [1][2]. One dilemma to solve was [3].

[1] https://github.com/w3c/browser-payment-api/issues/549
[2] https://github.com/w3c/browser-payment-api/pull/536
[3] https://github.com/w3c/browser-payment-api/pull/536#issuecomment-303996517
(In reply to Ben Tian [:btian] from comment #7)
> (In reply to Chris Mills (Mozilla, MDN editor) [:cmills] from comment #5)
> > But I'm a little confused - a sequence of DOMStrings seems programmatically
> > more useful than a single DOMString, so why change it? Do we only allow one
> > card to be input at a time, or will the DOMString contains more than one
> > payment method at once?
> 
> Please refer to discussions [1][2]. One dilemma to solve was [3].
> 
> [1] https://github.com/w3c/browser-payment-api/issues/549
> [2] https://github.com/w3c/browser-payment-api/pull/536
> [3]
> https://github.com/w3c/browser-payment-api/pull/536#issuecomment-303996517

Thanks for the useful comments Ben ... I now understand this ;-)

So, I've updated the page according to your above comments. I've deleted the "Chrome 57 later" example section completely, and just rolled the newest state of things into the main example.

It is probably not worth differentiating spec changes in the different examples when we are this early on in the spec process.
Whiteboard: [WP-MVP][M4]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: