w3c / payment-request

Payment Request API
https://www.w3.org/TR/payment-request-1.1/
Other
482 stars 183 forks source link

Proposed addition: validate .data on construction #976

Closed marcoscaceres closed 1 year ago

marcoscaceres commented 2 years ago

closes #975

The following tasks have been completed:

Implementation commitment:

Optional, impact on Payment Handler spec?


Preview | Diff


Preview | Diff

rsolomakhin commented 2 years ago

lgtm!

stephenmcgruer commented 2 years ago

Would it be useful to export a dfn here that can be pointed to by other specs, similarly to https://w3c.github.io/payment-request/#dfn-steps-to-check-if-a-payment-can-be-made (and respond, and change)? It's much easier to write other specs when you can say The [=steps to check if a payment can be made=] for [=my new payment method=] are: ....

(Also, I assume this change doesn't obsolete the steps to check if a payment can be made because technically handlers to methods are N:1, though in practice I think it is 1:1?)

(Also also, reminder - steps to check if a payment can be made have nothing to do with canMakePayment, they're actually a check used inside of show() :D)

marcoscaceres commented 2 years ago

@stephenmcgruer, yes to all of the above... the spec actually does need quite an editorial overhaul. We have various issues like #889, #814, and #767 - so it would be great to actually add more hooks as needed.

However, if it's ok, I'd like to do that as a followup to this 🙏

stephenmcgruer commented 2 years ago

However, if it's ok, I'd like to do that as a followup to this 🙏

Ack, sgtm. I'm happy to send a follow-on PR myself for the bit I care about most (having a <dfn> to link to, just because selfishly it would be useful for SPC currently :D).

marcoscaceres commented 2 years ago

@dcrousso, the working group is just wrapping up publishing the spec a W3C Recommendation (hopefully in the next 2 weeks). Right after we publish the Recommendation, we will immediately republish the specification with this amendment.

marcoscaceres commented 2 years ago

Landed in WebKit https://trac.webkit.org/changeset/286452/webkit .... still blocked on REC progress.

🔜