[w3c/payment-request] Treat scroll as a user gesture for PaymentRequest.show() (#797)

Today, PaymentRequest.show() does not show the payment method picker UI if all the following are true:
1) Merchant request payment via a URL-based payment method identifier.
2) User has a single payment handler for the payment method.
3) PaymentRequest.show() is triggered by a user gesture, such as a click.
3) Payment handler does not call PaymentRequestEvent.openWindow(url).

This makes it possible to build a seamless checkout experience that doesn't require any user interaction, once the first gesture is provided.

Currently "scroll" is not considered a user gesture for (3) above. This prevents me from building a scroll-to-pay flow, which can be very useful for paid web content.

Naively enabling "scroll" to be treated as a user gesture can lead to abuse. I think we can counter that in three ways:
1) Ask user during Payment Handler registration for permission to allow scroll-to-pay for this handler. They should also be able to change this setting in browser UI.
2) Optionally allow scroll-to-pay for only small amounts.
3) Display a non-intrusive UI in browser (e.g. a toast) after PaymentRequest.complete() is called to alert user that payment took place.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/797

Received on Monday, 22 October 2018 16:51:54 UTC