-
Notifications
You must be signed in to change notification settings - Fork 39
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
Should SPC be invokable outside of a PaymentRequest flow? #65
Comments
For completeness: SPC as described in the explainer is only usable in an informal payment context, not a web-api context. Although explainer-SPC uses the PaymentRequest API, it is not part of a PaymentRequest flow; it's just piggy-backing on the existing infrastructure. The explainer version of SPC can't be used inside a PaymentRequest flow (e.g. a web PaymentHandler), because PaymentRequests cannot be nested (step 8 of show() - https://w3c.github.io/payment-request/#show-method). |
@stephenmcgruer Since you requested input on a pretty fundamental issue, may I as an external comment on this? IMO, SPC is (or should at least be), a browser-built-in payment-handler, activated by the existing Other solutions and scenarios can presumably be supported by existing Web technologies. In case you want to discuss this further, please use my email: [email protected]. |
+1 on @cyberphone comments. Anything that is 1) not tied to the Payment Request API and 2) not FIDO has the net effect of making of the scope explode IMHO. The neat thing about the original SPC proposal was the the use case was clear, unequivocal and single-minded in its purpose. FIDO2 + Payment Request API === a chance of success and adoption. |
A closely related issue... This is how I envision SPC could appear on a merchant checkout page, here supporting three different payment networks: For Open Banking implementations, the name of the payment network would probably be something like "Pay with your Bank" . |
SPC is not an "API" it is a function. It should only be available inside the formal PR API call for the reasons specified in #56 (comment) I wouldn't read much into the API shape as defined in the explainer. @danyao and I agreed early on that the design for the experiments was simply a "quick and dirty" to get some data. My mental model for PR API is that it is simply the way a website invokes a payment context. We have already made some big simplifying changes to PR API through w3c/payment-request#955 to make it more flexible. I don't believe there is a concept of a "Payment Request flow" since the browser is no longer collecting data on behalf of the website. I imagine functions available inside the payment context being:
The specific functions available and invoked inside the payment context will differ depending on how the PR was constructed. E.g.
I think we should not get too far ahead in trying to design the API shape for SPC (or start assuming it won't be part of PR API) until we have ironed out the scope and requirements a little more. @cyberphone SPC is NOT intended to be a brand. It is an authentication and confirmation framework that can be leveraged by existing payment methods. The goal is to standardise the primitives for authN and confirmation so that this is possible. |
Thanks @adrianhopebailie I believe you and I agree, and are just using slightly different meanings for terminology. Everything in your post I agree with except the 'theory' parts (what constitutes a payment context :D). I have trouble explaining things here without relying on some concrete proposal, to be honest. The core of this issue was that I don't want merchants to have to switch to Payments-related web-APIs for anything other than SPC, to use SPC. That is, if a merchant, Alice, has a HTML-based guest checkout form setup that's working for her today (so no Payments web-APIs there), she should be able to integrate SPC to get strong user authentication without needing to adopt any other Payment APIs (such as, if you'll excuse the concrete example, the use of a PaymentHandler like basic-card, Apple Pay, or Google Pay). |
@adrianhopebailie writes
This excludes a wallet which @stephenmcgruer has in private communication mentioned as likely to be a part of SPC. Does the world really need yet another framework? Wouldn't a concrete system be easier to define, deploy, and market? A framework will be facing a virtual army of quite popular and useful mobile payment and banking applications. A Standardized, Vendor-independent, Convenient, Secure, Universal, and [potentially] Always Available alternative is (standards-wise) probably the only thing that could make a real impact in a market which currently have to cope with an ever-increasing number of "innovative" payment solutions. |
Hi all, (No strong feelings were expressed there.) |
@stephenmcgruer I think we are on the same page but perhaps have different ideas about HOW someone could use PR API, for example if all they want is SPC. You said (and I agree with this):
My expectation is that in this case Alice would create a new PR object but would not specify any payment methods (i.e. telling the browser she is not interested in invoking browser facilitated instrument selection or any third-party apps). She WOULD set a flag, or provide some input data (such as a list of credential IDs) that indicates she wishes to do SPC if it is available. This creates a clean DX where any functions related to payment are part of PR API. |
To elaborate a little on the DX and UX I have in mind here. When a merchant invokes a new payment flow they may have very little data already about who the user is and how they wish to pay (e.g. guest checkout) or they may have a lot of this data already (instruments, user id, credential ids etc). They should invoke the PR API, providing the data they do have and indicating to the browser (via the The flow, at a high level, works as follows, where the browser MAY facilitate any or none of the steps:
The flow is a 3-party flow involving the merchant, the RP, and the user with the browser as the mediator between them. The flow is invoked by the merchant calling PR API
Control is passed to the merchant via events on the PR object, to the RP via events in the RP's payment handler and to the user via UI rendered by the browser. My expectation is that there will be 3 ways to invoke SPC:
Example of 1: let details = {
total: {label: 'Total', amount: {currency: 'USD', value: '55.00'}},
secureConfirmation: {
credentialIds,
networkData
};
let options = {requestSecurePaymentConfirmation: true};
// Empty paymentMethods means skip instrument or payment handler selection
// Using PR constructor still gives us the structured payment details to use in confirmation
let request = new PaymentRequest([], details, options); Example of 2: let request = new PaymentRequest(methods, details, options);
// Merchant binds to instrument selection event so browser doesn't attempt to invoke payment handlers
// Instead user will be prompted to select a payment instrument from installed instruments filtered by supported payment methods
request.addEventListener('instrumentselected', async function(evt) {
const networkData = await getChallenge()
// Do SPC using the selected instrument and the challenge from the RP
const response = await evt.confirmPayment(networkData)
await response.complete('success')
}); Obviously this is very speculative but it provides some illustration of the direction I was imagining. Does it make sense? |
I would prefer to keep the API as simple as possible for a number of reasons. One of the things that I'd like to avoid is instrument selection in the browser UI, at least for now. That means the Distinguishing between the merchant and the RP and communicating with them in different ways also appears to introduce extra complexity without a well defined benefit. Can the API communicate only to the current web page? As for "Example 1", it seems counterintuitive to pass in 0 supported methods, but then add What do you think about an API shape like this: new PaymentRequest(
[{
supportedMethods: "secure-payment-confirmation",
data: {credentialIds, challenge, timeout},
}],
details); Cheers, |
If SPC can be called outside of PR API, then I suggest that we not follow the pattern of your example. SPC is not a payment method. It is an authentication approach. It is not a peer of GooglePay, ApplePay, SamsungPay, SRC, etc. It should be usable by them during PR API or by a payment app. It should also be usable for vanilla form-based payment flows. |
Could you provide more detail on how that would be accomplished?
That's what |
Yes, except this isn't a payment request. In my mind:
So I would not call "new PaymentRequest()" but "new SecurePaymentConfirmation()" |
SPC can also be viewed as "Get me some payment authentication credentials" 😉 |
I've mulled this over a bit and I can see the argument for non-PR API invocation of SPC. Assuming, based on the requirements, that the SPC Credential is some implementation of the It seems sensible (as suggested by @tblachowicz in #56) that a website should be able to simply call |
Very interesting, @adrianhopebailie!
Could you help to articulate this argument succinctly please? I am wondering whether it is a gut feel / preference derived from your extensive experience in the industry (it's great to have your expertise! 👍 ) and whether there are clear trade-offs "for" and "against" the different approaches.
Is the suggestion to add a special case for payments in There have been some discussions of re-using |
My understanding is that the answer to this question is:
|
SPC brings 3 things: Cryptographic proof, Payment specific display and Cross Domain ability. From @adrianhopebailie's comments it seems that The uncertainty for me is around the cross-domain access. Not sure if we would be able to manage that in |
Labeled after-v1 based on 3 March 2022 WG discussion https://www.w3.org/2022/03/03-wpwg-minutes |
Ian and I were chatting today and discovered that we had very different mental models about when SPC authentication is invokable; it seems worthwhile to hash these out and come to a conclusion that we can document (as part of the Scope document?).
Some casual definitions:
PaymentRequest.show()
, such as a web-basedPaymentHandler
) and as such is visible to the browser.Given these definitions, I believe that SPC authentication should be invokable in both informal and web-api payment contexts. Do others agree?
Note that if SPC is invokable in informal payment contexts, it is invokable anywhere on the web as the browser cannot tell the difference. It should always require a user gesture, imo, and the browser UX that will be shown should always state a payment context.
The text was updated successfully, but these errors were encountered: