Open
Description
Hi,
As part of looking into improving the privacy properties of Payment Handlers, I'd like to collect the known use cases for the "canmakepayment"
event. Here is what I have came up with so far:
- Kill switch: A payment app wants to globally disable the use of Web Payment API. A service worker may use the
“canmakepayment”
event for this purpose, in case if there is a bug that causes the Web Payment API flow to be broken. - Single instance: A payment app wants to prevent showing two instances of the payment UI at the same time. Chrome rejects any
PaymentRequest.show()
calls that happen while anotherPaymentRequest.show()
call is happening, but there is no way for web developers to know that the reject is going to happen ahead of time. A service worker may use the“canmakepayment”
event to check an in-memory boolean variable that is set to“true”
when this service worker is already handling an ongoing"paymentrequest"
event. (This implementation would not catch another origin's Payment Handler UI being displayed, however.) - Instrument on file: A payment app wants to check whether the user is logged in and has a payment instrument on file.
I'm assuming that the same use cases hold for Android payment apps.
What other use cases are out there? I'd love to hear feedback.
Thank you,
Rouslan
Metadata
Assignees
Labels
No labels