Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when errorFields don't match request[[options]] #807

Merged
merged 5 commits into from
Dec 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 53 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3111,26 +3111,62 @@ <h2>
<li>Set <var>response</var>.<a>[[\retryPromise]]</a> to
<var>retryPromise</var>.
</li>
<li data-link-for="PaymentValidationErrors" data-tests=
"PaymentValidationErrors/retry-shows-error-member-manual.https.html">
If <var>errorFields</var>'s <a>paymentMethod</a> member was passed,
and if required by the specification that defines
<var>response</var>'s <a>payment method</a>, then <a data-cite=
"WEBIDL#dfn-convert-ecmascript-to-idl-value">convert</a>
<var>errorFields</var> <a>paymentMethod</a> to an IDL value of the
type specified there. Otherwise, <a data-cite=
"WEBIDL#dfn-convert-ecmascript-to-idl-value">convert</a> to
<a data-cite="WEBIDL#idl-object">object</a>.
</li>
<li>If conversion results in a <a data-cite=
"WEBIDL#dfn-exception">exception</a> <var>error</var>:
<li>If <var>errorFields</var> was passed:
<ol>
<li>Reject <var>retryPromise</var> with <var>error</var>.
<li>Optionally, show a warning in the developer console if any of
marcoscaceres marked this conversation as resolved.
Show resolved Hide resolved
the following are true:
<ol>
<li>
<var>request</var>.<a>[[\options]]</a>["<a data-link-for=
"PaymentOptions">requestPayerName</a>"] is false, and
<var>errorFields</var>["<a data-link-for=
"PaymentValidationErrors">payer</a>"]["<a data-link-for=
"PayerErrors">name</a>"] is present.
</li>
<li>
<var>request</var>.<a>[[\options]]</a>["<a data-link-for=
"PaymentOptions">requestPayerEmail</a>"] is false, and
<var>errorFields</var>["<a data-link-for=
"PaymentValidationErrors">payer</a>"]["<a data-link-for=
"PayerErrors">email</a>"] is present.
</li>
<li>
<var>request</var>.<a>[[\options]]</a>["<a data-link-for=
"PaymentOptions">requestPayerPhone</a>"] is false, and
<var>errorFields</var>["<a data-link-for=
"PaymentValidationErrors">payer</a>"]["<a data-link-for=
"PayerErrors">phone</a>"] is present.
</li>
<li>
<var>request</var>.<a>[[\options]]</a>["<a data-link-for=
"PaymentOptions">requestShipping</a>"] is false, and
<var>errorFields</var>["<a data-link-for=
"PaymentValidationErrors">shippingAddress</a>"] is present.
</li>
</ol>
</li>
<li>Set <a>user agent</a>'s <a>payment request is showing</a>
boolean to false.
<li data-link-for="PaymentValidationErrors" data-tests=
"PaymentValidationErrors/retry-shows-error-member-manual.https.html">
If <var>errorFields</var>["<a>paymentMethod</a>] member was
passed, and if required by the specification that defines
<var>response</var>'s <a>payment method</a>, then <a data-cite=
"WEBIDL#dfn-convert-ecmascript-to-idl-value">convert</a>
<var>errorFields</var>'s <a>paymentMethod</a> member to an IDL
value of the type specified there. Otherwise, <a data-cite=
"WEBIDL#dfn-convert-ecmascript-to-idl-value">convert</a> to
<a data-cite="WEBIDL#idl-object">object</a>.
</li>
<li>Return.
<li>If conversion results in a <a data-cite=
"WEBIDL#dfn-exception">exception</a> <var>error</var>:
<ol>
<li>Reject <var>retryPromise</var> with <var>error</var>.
</li>
<li>Set <a>user agent</a>'s <a>payment request is showing</a>
boolean to false.
</li>
<li>Return.
</li>
</ol>
</li>
</ol>
</li>
Expand Down