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

Update of PMI spec #16

Merged
merged 7 commits into from Nov 28, 2016
Merged

Update of PMI spec #16

merged 7 commits into from Nov 28, 2016

Conversation

ianbjacobs
Copy link
Contributor

- takes into account Lisbon discussion
https://www.w3.org/2016/09/20-wpwg-minutes#item04
- takes into account 10 Nov discussion
https://www.w3.org/2016/11/10-wpwg-minutes.html#item02
- Defines both URLs (when manifests needed) and W3C-minted short strings
- New section on more sophisticated matching beyond PMI matching
Copy link
Contributor

@adrianhopebailie adrianhopebailie left a comment

Choose a reason for hiding this comment

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

Awesome updates. I'd recommend defining the manifest in this spec too?

Some comments require changes but some are just questions.

<p>Payment method identifiers are strings containing a <a>URL</a>. The string MUST be an <a>absolute URL</a>.</p>
<h2>Syntax</h2>
<p>When URLs are used for payment method identifiers they MUST
be absolute URLs including only the schema, origin, and path parts. The URL scheme MUST be <code>https</code>. These URLs MUST NOT include query string parameters or fragment identifiers.</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Would we ever support other secure schemes (besides https) that are, for example, less susceptible to DDoS attacks? (Like IPFS...)

Do we need to be more generic and just say "secure protocol"?

Also, could we leverage Subresource Integrity somehow to ensure the integrity of the manifest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suggest we discuss these at the 17 Nov call (as well as whether the Manifest spec should be included in the PMI Spec).

Copy link
Contributor

Choose a reason for hiding this comment

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

#17

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Adrian,

Per discussion at teleconf today, I've added a link to issue 17 in updates to the pull request.

<p>When the PaymentRequest API is invoked, the web page provides a list of identifiers for supported payment methods.
The user agent must compare these identifiers to those available to the user and use this to filter what the user
can select. To determine whether two identifiers match, perform the following test:</p>
<h2>Matching</h2>
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if the URL parser returns failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd like to hear from user agent implementers.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we put in a placeholder that shows this behaviour needs to be defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Two notes:

  1. I don't think this specification should say how to handle strings that are neither URLs nor W3C short strings. Behavior may vary in different contexts.
  2. Similarly, I don't think this specification should say what to do when there is, for example a 404 on a manifest file.

So if the URL parser fails, it means that the string is not a PMI per this specification (unless it happens to be a W3C short string). When the parser fails, the browser might do any number of things, including (1) still trying to match the string (2) ignoring the string. I think that the PR API spec should speak to this behavior but not the PMI spec.

Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly, I don't think this specification should say what to do when there is, for example a 404 on a manifest file.

I think we'll need to add that when we add the manifest stuff to this spec but happy to do that later when @maxpassion has this ready.

I think that the PR API spec should speak to this behavior but not the PMI spec.

There seems to be a lot of work still required on the show() algorithm to call out to the PMI matching now that we have that defined. https://w3c.github.io/browser-payment-api/#show-method

Happy to move it there but we should probably give the caller some indication that method identifiers have been removed (Step 8) /cc @adrianba @zkoch @rvm4

payment apps. W3C identifies these payment methods with (short) strings; W3C expects to mint these strings in payment method specifications published by the Web Payments Working Group.</p>
<section>
<h2>Syntax</h2>
<p>The syntax of W3C strings used as payment method identifiers is constrained by this regular expression: <code>[a-z0-9-]+</code></p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Put regex in a freestanding code block or at least new line

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've pushed a change that puts the snippet in a pre

represent different conditions. This scalable approach may work
well for a small number of independent conditions, but
may not scale well for complex relationships.</li>
<li>Payment methods may define "filters." Merchants provide
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe mention that filtering is defined in the payment method specs and that support is not a normative requirement of this spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think that's necessary because the text says "Payment methods may define filters" which means that the definitions would be in payment method specifications.

Copy link
Contributor

Choose a reason for hiding this comment

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

My point was to be (more) explicit about why there is no filtering behaviour defined here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Your original suggestion had two parts: (1) filtering is defined in payment method specs. I think that is covered by the existing text. (2) support is not a normative requirement of this spec. I think silence on the matter is equivalent in this case.

Your last comment is to say "why" there is no filtering behavior defined here. Do you have suggested text for that rationale?

Ian

Copy link
Contributor

Choose a reason for hiding this comment

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

Payment methods may define "filters". These are used by callers of the API to affect the payment method identifier matching behavior. No generic filtering mechanism is defined therefor support for filtering is dependent on the level of support that implementations have for the payment methods that define "filters".

Per discussion at the 17 Nov call [1], added link to issue 17.
Expectation is that the spec will be revised in TR space with these
edits, then we will address new issues (and inclusion of manifest
information) in subsequent drafts.

[1] https://www.w3.org/2016/11/17-wpwg-minutes#item03
Take into account (but not verbatim) AHB text
@ianbjacobs
Copy link
Contributor Author

Adrian, I took another pass at the filter description based on your text. It's not exactly what you wrote but I hope captures your intent.

filter alignment. Please note that at this time the
Working Group's expectations is that filters will be
defined within payment methods; there will not be
"generic" filters that work across payment methods.</li>
</ul>
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

@ianbjacobs ianbjacobs merged commit 7268420 into w3c:gh-pages Nov 28, 2016
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.

None yet

3 participants