Skip to content

editorial: better payment handler integration - #700

Merged
marcoscaceres merged 6 commits into
gh-pagesfrom
handler_integration
May 8, 2018
Merged

marcoscaceres merged 6 commits into
gh-pagesfrom
handler_integration

Conversation

@marcoscaceres

@marcoscaceres marcoscaceres commented Apr 6, 2018 •

Copy link
Copy Markdown
Member

@marcoscaceres
marcoscaceres force-pushed the handler_integration branch 2 times, most recently from 4cc3fea to ef8ea4d Compare April 6, 2018 08:04
@marcoscaceres

Copy link
Copy Markdown
Member Author

@domenic, this hooks into w3c/payment-method-basic-card#52 so might be good to review them together.

@marcoscaceres
marcoscaceres requested a review from ianbjacobs April 6, 2018 08:08
@marcoscaceres

Copy link
Copy Markdown
Member Author

@ianbjacobs, builds on your other PR. Would be good for you to check the intro text I changed.

Comment thread index.html Outdated
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]].

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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."

Comment thread index.html
</li>
<li>Let <var>handler</var> be the <a>payment handler</a> that the
user is interacting with via <var>request</var>.
</li>

@ianbjacobs ianbjacobs Apr 6, 2018 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@marcoscaceres

Copy link
Copy Markdown
Member Author

@domenic, when you can, would appreciate your review on this one (which hooks into w3c/payment-method-basic-card#52).

@domenic domenic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work to create this layering in general.

Comment thread index.html Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo "wether"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL: wether (wɛðə) noun, a castrated ram 🤭

Comment thread index.html Outdated
<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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Making this a definition list. There are few more of these to come...

Comment thread index.html Outdated
</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=

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/results with/returns

"object, or dictionary, that" -> "object or dictionary that"

Comment thread index.html Outdated
<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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"a a" -> "a"

Comment thread index.html Outdated
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"specific for" -> "specific to"

Comment thread index.html Outdated
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>.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "can handle [a] payment request"? It seems like another algorithm :-/.

Maybe just "registered payment handlers for the payment method identifier" or something?

Comment thread index.html Outdated
handle payment request for <var>identifier</var>.
</li>
<li>If <var>registeredHandlers</var> is empty, then continue.
</li>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Comment thread index.html
<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>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments apply to this section.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed also.

Comment thread index.html Outdated
<var>handler</var>'s <a>can make payment</a> algorithm with
<var>data</var>.
</li>
<li>If <var>canMakePayment</var> is true, return true.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolve promise with true, and return.

Comment thread index.html
algorithm of [[payment-method-basic-card]].
</dd>
<dt>
<dfn>Steps to respond to a payment request</dfn>:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is one an algorithm and one steps?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why is "can make payment" an algorithm and "respond to a payment request" steps?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that’s no good. Will make them consistent.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed bug in basic card and will fix here too. w3c/payment-method-basic-card#55

@marcoscaceres

Copy link
Copy Markdown
Member Author

Merging this in, but happy to clarify #700 (comment) further if needed in a separate PR.

@marcoscaceres
marcoscaceres merged commit 461dbab into gh-pages May 8, 2018
@marcoscaceres
marcoscaceres deleted the handler_integration branch May 8, 2018 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants