-
Notifications
You must be signed in to change notification settings - Fork 42
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
Remove "instrument" concept from PaymentManager #371
Comments
If we look from the perspective of the wallet, in the generic meaning, it actually makes a lot of sense to have PaymentInstrument concept. I think most of the Payment Apps allow selection of some soft of the instrument, and the payment is facilitated using the specific payment instrument. To me, the concept is much more generic than only credit cards. For wallets such as xPays the payment instrument is the payment card (credit, debit or other), for Open Banking aggregators it would be specific bank account to pay with and so on. |
Is it possible for the user to consider the user agent as the wallet and all of the individual payment apps as "instruments"? |
Yes "payment instrument" is a real-world concept and won't go away. This bug is about the technical question of whether "payment instrument" should be exposed to the browser in the web payments architecture. Framed from the user's perspective, the question is: should the browser offer users choices of payment apps or choices of payment instruments from within the apps? So far, there is no payment handler that actually leverages the capability of exposing instruments to the browser. So I'm taking this as a signal that this capability is not useful. Removing it would simplify browser's implementation. But if a developer demonstrates a real use case for this capability, we would definitely consider keeping it. |
It's one of the fundamental questions for Web Payments. As a user, I personally would prefer a selection of the payment apps, but I guess there might be good arguments for the alternative approach.
At the moment there are very little payment handlers in general, so I doubt the conclusion that the capability of exposing instruments is not useful. We've tried in one of the early prototypes to expose multiple instruments from single payment handler and it didn't work as expected in Chrome, because the instruments weren't displayed on the list. |
As per my understanding currently, the payment instrument is the only way to specify which payment method given payment handler supports. Payment manager sets the payment instrument with the method specifying the payment method identifier. In case of payment instrument is removed from the specification there must be the other way to specify the supported methods, preferably in the manifest as the delegation can be specified. |
The
Fair enough.
Can you elaborate a bit more how it didn't work as expected? What's the ideal user flow you'd like to achieve? |
Hello, Also, that the spec is called Payment Handler API but the main concept it introduces is called Payment Instrument adds unnecessary complexity. It could be just handler or just instrument. |
Personally I find a web manifest approach inconsistent with the design of Web APIs in general and would very much prefer keeping the current API-based approach. |
See updates to Chromium to remove instruments: |
* Remove PaymentInstruments API PaymentInstruments is the Web API that backs non-JIT install of payment apps. It was designed with the assumption that the browser would store the actual payment instrument details, which has not turned out to be true, and has some privacy leaks. This patch removes the ability to register a payment handler via paymentManager.instruments API. Only just-in-time installation is supported from now on. Chrome tracking bug: https://crbug.com/1327265 Chrome status: https://chromestatus.com/feature/5099285054488576 Overview of changes in the patch: * Remove PaymentInstruments interface. * Remove no longer used PaymentInstrument and ImageOjbect dictionaries. * Mark PaymentManager exposed only on Window (not Worker) to match the Chrome implementation. * Add a definition for "payer" for symmetry with "payee" definition. * Soften the language around the purpose for the "canmakepayment" event to match Chrome implementation, where it is being used for hasEnrolledInstrument() instead of canMakePayment() and show(). * Add a promise to the "canmakepayment" example to reduce confusion stemmed from many examples that always unconditionally return "true". * Remove the unused PaymentRequestEvent.fetchedImage internal slot. * Raise 2nd level sections to 1st level for clarity. Closes: #371 Closes: #381 Co-authored-by: ianbjacobs <[email protected]> Co-authored-by: stephenmcgruer <[email protected]>
The
PaymentInstruments
[1] concept was originally designed to support multiple credit cards. It adds confusion to payment handlers that are not fundamentally about credit cards. Since Payment Request API is moving towards payment apps being the atomic building blocks instead of instruments, I think it will be more clear to change payment handler registration interface to something like this:Today many parts of
PaymentInstruments
are not used:PaymentInstruments.set()
capabilities
only has well-defined meaning forbasic-card
payment methodWith the proposed change to remove the
PaymentInstrument
concept, the web app manifest can become the authoritative source of information about the payment handler, such as name, icons, capabilities. This will also better unify just-in-time installation and explicit installation of payment handlers.[1] https://w3c.github.io/payment-handler/#paymentinstruments-interface
The text was updated successfully, but these errors were encountered: