Repository navigation
editorial: better payment handler integration - #700
Conversation
4cc3fea to
ef8ea4d
Compare
ef8ea4d to
eb1b1f6
Compare
|
@domenic, this hooks into w3c/payment-method-basic-card#52 so might be good to review them together. |
|
@ianbjacobs, builds on your other PR. Would be good for you to check the intro text I changed. |
| of this object is specific for each <a>payment handler</a>. For an | ||
| example of such an object, see the <code><a data-cite= | ||
| "payment-method-basic-card#dom-basiccardresponse">BasicCardResponse</a></code> | ||
| dictionary of [[payment-method-basic-card]]. |
There was a problem hiding this comment.
Please change "The structure of this object is specific for each payment handler" to "The structure
of this object is specific for each payment method."
| </li> | ||
| <li>Let <var>handler</var> be the <a>payment handler</a> that the | ||
| user is interacting with via <var>request</var>. | ||
| </li> |
There was a problem hiding this comment.
Could we say "Let handler be the payment handler selected by the user." ?
For some envisioned cases of frictionless payments, there may not be user interaction other than selection by the
user.
|
@domenic, when you can, would appreciate your review on this one (which hooks into w3c/payment-method-basic-card#52). |
domenic
left a comment
There was a problem hiding this comment.
Great work to create this layering in general.
| method</a> is an implementation detail of a <dfn data-lt= | ||
| "payment handlers">payment handler</dfn>. Additionally, each payment | ||
| handler defines a <dfn>can make payment</dfn> algorithm. The details of | ||
| how a payment handler determines wether it, or the user, can |
There was a problem hiding this comment.
TIL: wether (wɛðə) noun, a castrated ram 🤭
| <a>user agent</a>, but future specifications may expand on the | ||
| processing model in more detail. | ||
| method</a> is an implementation detail of a <dfn data-lt= | ||
| "payment handlers">payment handler</dfn>. Additionally, each payment |
There was a problem hiding this comment.
Is this "Additionally," or should it be "Concretely,"? The "can make payment" algorithm seems like a concrete realization of the previous sentence; it doesn't seem like some additional unrelated thing.
There was a problem hiding this comment.
Making this a definition list. There are few more of these to come...
| </p> | ||
| <p> | ||
| A payment handler also defines the <dfn>steps to respond to a payment | ||
| request</dfn>, which results with an object, or <a data-cite= |
There was a problem hiding this comment.
s/results with/returns
"object, or dictionary, that" -> "object or dictionary that"
| <p> | ||
| A payment handler also defines the <dfn>steps to respond to a payment | ||
| request</dfn>, which results with an object, or <a data-cite= | ||
| "!WEBIDL#idl-dictionary">dictionary</a>, that a a merchant uses to |
| request</dfn>, which results with an object, or <a data-cite= | ||
| "!WEBIDL#idl-dictionary">dictionary</a>, that a a merchant uses to | ||
| process or validate the transaction. The structure of this object is | ||
| specific for each <a>payment method</a>. For an example of such an |
There was a problem hiding this comment.
"specific for" -> "specific to"
| then add payment handler to <var>handlers</var>. | ||
| <li>Let <var>registeredHandlers</var> be a <a>list</a> of | ||
| registered <a>payment handlers</a> that are authorized and can | ||
| handle payment request for <var>identifier</var>. |
There was a problem hiding this comment.
What is "can handle [a] payment request"? It seems like another algorithm :-/.
Maybe just "registered payment handlers for the payment method identifier" or something?
| handle payment request for <var>identifier</var>. | ||
| </li> | ||
| <li>If <var>registeredHandlers</var> is empty, then continue. | ||
| </li> |
There was a problem hiding this comment.
This continue step (and the "Otherwise" on the next line) is unnecessary. You can for each over an empty list with no problem (just like in JS).
| <li>If conversion results in an error, reject <var>promise</var> | ||
| with that error and terminate this algorithm. | ||
| </li> | ||
| <li>If the user agent has a registered <a>payment handler</a> |
There was a problem hiding this comment.
Same comments apply to this section.
| <var>handler</var>'s <a>can make payment</a> algorithm with | ||
| <var>data</var>. | ||
| </li> | ||
| <li>If <var>canMakePayment</var> is true, return true. |
There was a problem hiding this comment.
Resolve promise with true, and return.
| algorithm of [[payment-method-basic-card]]. | ||
| </dd> | ||
| <dt> | ||
| <dfn>Steps to respond to a payment request</dfn>: |
There was a problem hiding this comment.
Why is one an algorithm and one steps?
There was a problem hiding this comment.
So, what I was trying to say here is that a payment handler will need to implement or specify this (i.e., what's here is informative).
There was a problem hiding this comment.
But why is "can make payment" an algorithm and "respond to a payment request" steps?
There was a problem hiding this comment.
Yeah, that’s no good. Will make them consistent.
There was a problem hiding this comment.
Filed bug in basic card and will fix here too. w3c/payment-method-basic-card#55
|
Merging this in, but happy to clarify #700 (comment) further if needed in a separate PR. |
Depends on w3c/payment-method-basic-card#52
Preview | Diff