Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Connecting to payment request. #50

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 10 additions & 23 deletions index.html
Expand Up @@ -231,40 +231,27 @@ <h2>
Interfacing with a payment handler
</h2>
<p>
The <dfn>steps to filter payment handlers</dfn> with
The <dfn>steps to check instrument support</dfn> with
<a>BasicCardRequest</a> <var>data</var> are given by the following
Copy link
Member

Choose a reason for hiding this comment

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

The hook for this occurs at step 6.1:

For each methodData in request.[[serializedMethodData]]:
If methodData.supportedMethods is a supported payment method identifier (including its payment method specific capabilities), resolve promise with true, and abort this algorithm.

Which should become (in the PR API):

For each methodData in request.[[serializedMethodData]]:

  1. Let pmi be methodData.supportedMethods.
  2. If pmi has no associated payment handler, continue.
  3. If the user has configured the user agent to allow requests to be handled by the payment handler corresponding to pmi, resolve promise with true.
    Note: we add note about privacy.
  4. Otherwise, run the "steps to check instrument support" with methodData for pmi. If "steps to check instrument support" return true, resolve promise with true. Otherwise, continue.
    Resolve promise with false.

algorithm. If the payee invokes
<code>paymentRequest.canMakePayment()</code> or
<code>paymentRequest.show()</code>, the algorithm returns
<code>true</code> for matching cards. In case of
<code>canMakePayment()</code>, the output of this algorithm is returned
to the payee. In case of <code>show()</code>, the output of this
algorithm determines whether a payment handler is presented to the
user.
algorithm.
</p>
<ol class="algorithm" data-link-for="BasicCardResponse">
<li data-link-for="BasicCardRequest">Let <var>requestedNetworks</var>
be <var>data</var>["<a>supportedNetworks</a>"].
</li>
<li data-link-for="BasicCardRequest">Let <var>requestedTypes</var> be
<var>data</var>["<a>supportedTypes</a>"].
</li>
<li>If the <a>primary account number</a> is not from one of the
<ol class="algorithm">
<li>If the <a>card</a>'s <a>network</a> is not one of the
<a>networks</a> in <var>requestedNetworks</var> and
<var>requestedNetworks</var> is not empty, return <code>false</code>.
</li>
<li>Otherwise, if the <a>primary account number</a> is not from one of
the <a>types</a> in <var>requestedTypes</var> and
<var>requestedTypes</var> is not empty, return <code>false</code>.
<li>Otherwise, if the <a>card</a>'s <a>type</a> is not one of the
<a>types</a> in <var>requestedTypes</var> and <var>requestedTypes</var>
is not empty, return <code>false</code>.
</li>
<li>Otherwise, return <code>true</code>.
</li>
</ol>
<p>
The <dfn>steps to select a payment handler</dfn> are given by the
The <dfn>steps to respond to a payment request</dfn> are given by the
following algorithm. If the end user inputs or selects a <a>card</a>
that meets the constraints of <var>data</var>, the algorithm returns a
card as a <a>BasicCardResponse</a>.
that meets the constraints of <a>BasicCardRequest</a> <var>data</var>,
the algorithm returns a card as a <a>BasicCardResponse</a>.
</p>
<ol class="algorithm" data-link-for="BasicCardResponse">
<li data-link-for="BasicCardRequest">Let <var>requestedNetworks</var>
Expand Down