-
Notifications
You must be signed in to change notification settings - Fork 135
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
Validate PMIs, ignore duplicates #581
Conversation
Working on tests... will update OP as I send them to the WPT repo. |
@zkoch and @adrianba can you confirm that this matches the implementation on Edge and Chrome. I read the proposed text to not allow this: new PaymentRequest(
[
{
supportedMethods: "basic-card",
data: {
supportedTypes: ["debit"],
supportedNetworks: ["visa", "amex"],
}
},
{
supportedMethods: "basic-card",
data: {
supportedTypes: ["credit"],
}
},
],
details
); ...implying, I accept credit cards from all networks but debit cards only from VISA and Mastercard. I think that is a mistake. |
If @adrianhopebailie is correct, then I agree there is an issue because that is behavior we sought to enable. |
Please see also: w3c/payment-method-basic-card#36 (comment) |
Questions is, how often does @adrianhopebailie's straw-person occur? and, given that .data is acting as a hint, should the merchant in that case just accept all things in a network (both credit and debit). If it's rare (e.g. 1% of the time), I'm still inclined to "use first matching". I've never encountered this in the wild - so I'm curious. |
@mattsaxon, @mountainhippo, @lyverovski, could you provide information about the scenario @adrianhopebailie describes, something like "I accept credit cards from all networks but debit cards only from VISA and Mastercard." Thanks! Ian |
@zkoch, opinions? What are you seeing on the Chrome side or hearing from merchants? Is the situation in #581 (comment) rare? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EDITORIALLY, lgtm with nits. It seems like people are still discussing the behavior from a normative perspective.
index.html
Outdated
@@ -519,8 +519,35 @@ | |||
then <a>throw</a> a <a>TypeError</a>, optionally informing the | |||
developer that at least one <a>payment method</a> is required. | |||
</li> | |||
<li>Let <var>seenPMIs</var> be an emtpy list. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: "empty" misspelled
index.html
Outdated
the developer that the payment method identifier is | ||
invalid. | ||
</li> | ||
<li>If <a>seenPMIs</a> contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a>
-> <var>
index.html
Outdated
@@ -2520,6 +2559,20 @@ | |||
exception, then <a>abort the update</a> with that | |||
exception. | |||
</li> | |||
<li>If <a>seenPMIs</a> contains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a>
-> <var>
@dontcallmedom, seems the IPR bot is stuck again🕵️♀️ |
Marked as substantive for IPR from ash-nazg. |
@marcoscaceres fixed ; if you have other PRs stuck that way, let me know - this was due to the previous temporary breakage. |
Discussed on the editor's call today, we will modify the algorithm to take multiple "supportedNetworks". In the Basic Card spec we will then only use the first matching |
859e175
to
5e6ca6d
Compare
This seems relevant to Basic Card not Payment Request. Does that mean changes are still needed for PR? |
Yes, but just the validation of the PMI. |
Added missing tests. web-platform-tests/wpt#7021 |
Blocked awaiting test review. |
Validate supportedMethods (closes validate supportedMethods #464)
Defines behavior for duplicate PMIs in constructor and updateWith() (closes Behavior for multiple modifiers for the same payment method is not defined #309)
ctor PMI check tests: Payment Request throws if PMIs is invalid web-platform-tests/wpt#6816
updateWith() PMI validity tests: PMI verification tests web-platform-tests/wpt#7021
Preview | Diff