CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 137
Add PaymentRequest.prototype.hasEnrolledInstrument() #833
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
Conversation
Thanks @danyao! I’ll try to review this ASAP! |
Thanks! I forgot to update the PaymentRequest interface with the new method in the first commit. This is fixed now. |
Co-Authored-By: danyao <danyao@chromium.org>
Co-Authored-By: danyao <danyao@chromium.org>
Co-Authored-By: danyao <danyao@chromium.org>
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.
Hi @danyao, this is a great start - and the algorithm parts are looking pretty solid...
However, I'd like to do this in two parts because there is some duplication in the two algorithms that I'd like to avoid (mostly an editorial/maintenance issue). Also note that the hasEnrolledInstrument()
doesn't seem to integrate with the state machine like the other methods.
For example, right now:
pr = new PaymentRequest("")
await pr.abort();
await pr.canMakePayment(); //throws
await pr.hasEnrolledInstrument(); // doesn't throw.
I think we should have a single algorithm in the Algorithms sections. The algorithm should be called:
"can make payment algorithm" and have it take an argument Boolean <var>checkForInstruments</var>
that if passed as "carview.php?tsp=true", it does the instrument check.
Then, instead of:
The <a>canMakePayment()</a> method MUST act as follows:
It would be:
The <a>canMakePayment()</a> method MUST run the <a>can make payment algorithm</a> with the <var>checkForInstruments</a> set to false.
Then, instead of:
The <a>hasEnrolledInstrument()</a> method MUST act as follows:
It would be:
The <a>hasEnrolledInstrument()</a> method MUST run the <a>can make payment algorithm</a> with the <var>checkForInstruments</a> set to true.
Now I'm wondering if we should just add a optional dictionary to pr.canMakePayment({ withEnrolledInstruments: true }); |
That would make feature detection difficult, so I would advise against it.
…On Sun, Feb 10, 2019 at 9:34 PM Marcos Cáceres ***@***.***> wrote:
Now I'm wondering if we should just add a dictionary optional dictionary
to canMakePayment():
pr.canMakePayment({ withEnrolledInstruments: true });
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#833 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AQ8khuzXcGJjVsRvq6K7637GkPr2VUpSks5vMNaBgaJpZM4awNC_>
.
|
Firefox would likely never return this information truthfully for built in methods regardless (i.e., we will always return true), so I don’t see what difference it makes from a feature detection POV? |
(Note the hasEnrolledInstruments() would introduce another fingerprinting vector - so we might want to document that in the Privacy and Security section, and we should make it ok for UAs to lie for privacy reasons). |
Chrome would return the
Privacy and Security section changes sound reasonable.
Did you have in mind returning |
Ok, let’s go with the new name 👍 about the exceptions, see my suggestion about using the same abstract algorithm for both this an canMakePayment(). Then they are both protected by the same abuse checking. |
Co-Authored-By: danyao <danyao@chromium.org>
Co-Authored-By: danyao <danyao@chromium.org>
Co-Authored-By: danyao <danyao@chromium.org>
…this method no longer exposes new user agent configuraton
Hi @marcoscaceres, thanks for the feedback!
Consolidating redundant algorithm makes sense. I went the other way initially because I felt it may be confusing to embed an "if" and the rate-limit note inside the loop. I gave it another try. PTAL. Also note that the
This would be a bug. How did you test it? I added a manual WPT test case for this scenario and it was passing on my debug build, but I could have overlooked something: https://github.com/web-platform-tests/wpt/blob/master/payment-request/payment-request-hasenrolledinstrument-method-manual.https.html#L81
Updated the Privacy Considerations section. PTAL. Do you think it's important to keep the abuse protection for |
Friendly ping @marcoscaceres. I've responded to your feedback. PTAL. |
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.
Friendly ping, @aestes. |
Co-Authored-By: danyao <danyao@chromium.org>
Hi @marcoscaceres, Now that this PR is approved, what would be the best next step? Should we create a 1.1 branch to commit this? |
@plehegar do you have guidance here for introducing a new branch? Ian |
@danyao @plehegar @ianbjacobs, my preference is for us not to spin up new branches as we are almost ready to republish in the next 2 weeks. @danyao, just hang tight, we are almost done with 1.0. Once the new CR is out, we don't expect any significant feedback - so it will be easier to deal with back porting, or uplifting, changes as needed (and all this stuff will go into the |
If we can get commitment from one more implementer we can land this. |
@danyao, @rsolomakhin, @zouhir, @aestes see above request from @marcoscaceres. :) |
@ianbjacobs : This is shipped in Chrome and there's a bug in WebKit. Is that sufficient? |
@rsolomakhin, excellent! thanks for doing the archeology! Yep, that's good enough. |
That sounds like 2 implementation commitments. @marcoscaceres, seem ok? |
@danyao could you please check the merge conflict? I can modernize the markup a bit after we merge. |
Yep I'll take a pass later today. Thanks for keeping on top of this!
…On Tue, Apr 30, 2019 at 10:29 AM Marcos Cáceres ***@***.***> wrote:
@danyao <https://github.com/danyao> could you please check the merge
conflict? I can modernize the markup a bit after we merge.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#833 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACPSIXDEFES5UQZNL5LONPLPTBJWDANCNFSM4GWA2C7Q>
.
|
Hi @marcoscaceres - I fixed the merge conflicts. PTAL! |
Thanks @danyao! looks great. |
closes #830
The following tasks have been completed:
Implementation commitment:
Optional, impact on Payment Handler spec?
After this change,
CanMakePaymentEvent
will not be triggered on any payment handler whencanMakePayment()
runs. It will be triggered whenhasEnrolledInstrument()
runs.Preview | Diff