Open Bug 1469419 Opened 6 years ago Updated 2 years ago

Figure out and implement what should happen when there are two active calls to PaymentRequest.show

Categories

(Core :: DOM: Web Payments, enhancement, P1)

enhancement

Tracking

()

People

(Reporter: mrbkap, Unassigned)

References

(Blocks 3 open bugs)

Details

(Keywords: dev-doc-needed, testcase, Whiteboard: [webpayments-reserve])

In bug 1442453 I removed some code that was attempting to enforce the constraint that: "there should only be one active call to PaymentRequst.show() per tab at any given time."

The current behavior, as it stands after the patches for bug 1442453 is not great: we'll allow one active show call per process. That would lead to (from the user's point of view) random tabs refusing to open a second payment dialog.

It would be relatively easy to re-implement the "one active request per tab" behavior or even a "only one request allowed globally" policy or anything in between.
Priority: P1 → --
Whiteboard: [webpayments] → [webpayments] [triage]
Priority: -- → P3
Whiteboard: [webpayments] [triage] → [webpayments-reserve]
This ought to be documented.
Keywords: dev-doc-needed
Blocks: 1478740
Blocks: 1478750
Flags: qe-verify+
QA Contact: hani.yacoub
Whiteboard: [webpayments-reserve] → [webpayments-reserve] [triage]
Priority: P3 → --
Whiteboard: [webpayments-reserve] [triage] → [webpayments] [triage]
Priority: -- → P2
Whiteboard: [webpayments] [triage] → [webpayments-reserve]
We'll use this bug to track the post-M3 long term solution while bug 1478740 will handle the short-term solution (app-modal).
Priority: P2 → P3
Priority: P3 → P2
Summary: Figure out and implement what should happen when there are two active calls to PaymentRequst.show → Figure out and implement what should happen when there are two active calls to PaymentRequest.show
On the front-end we have now landed our tab-modal dialog (see bug 1435871 and meta bug 1433047) so we'd like to switch to allowing multiple simultaneous Payment Request dialogs to be shown for separate tabs. It's very confusing to click a checkout button in one window or tab but have it not show the dialog just because one tab is already showing one.
Priority: P2 → P1
> It's very confusing to click a checkout button in one window or tab but have it not show the dialog just because one tab is already showing one.

Understood. We can definitely support this for now, but we should keep in mind that we might need to revert back in the future if we need to rely on biometric verification for payments (where the verification challenge will likely be bound to a particular payment request instance).
Yeah, that's a possibility but I also think it's possible to have a UX where you can support multiple simultaneous requests and not have ambiguous confirmations.
(In reply to Matthew N. [:MattN] (PM me if requests are blocking you) from comment #5)
> Yeah, that's a possibility but I also think it's possible to have a UX where
> you can support multiple simultaneous requests and not have ambiguous
> confirmations.

Agree. Let's deal with the basic card case for now (one-per-tab is great!).
So to be clear, we are intentionally going against the specification, which specifically says that only one payment panel should be displayed at once, yes? As per the spec:

'It is not possible to show multiple PaymentRequests at the same time within one user agent. If a PaymentRequest is already showing, calling show() —from any Web site— will return a promise rejected with an "AbortError" DOMException.

I have no complaint about that necessarily; I just want to be sure we're going in with both eyes open. This also introduces some interesting documentation things to figure out. :)
Yes, that's correct. See bug 1478740 comment 4 where I mentioned the wilful violation.
(In reply to Eric Shepherd [:sheppy] from comment #7)
> So to be clear, we are intentionally going against the specification, which
> specifically says that only one payment panel should be displayed at once,
> yes? As per the spec:
> 
> 'It is not possible to show multiple PaymentRequests at the same time within
> one user agent. If a PaymentRequest is already showing, calling show() —from
> any Web site— will return a promise rejected with an "AbortError"
> DOMException.

I've sent a PR to fix this in the spec :) 
https://github.com/w3c/payment-request/pull/811

 
> I have no complaint about that necessarily; I just want to be sure we're
> going in with both eyes open. This also introduces some interesting
> documentation things to figure out. :)

So, if the PR gets accepted (which I think it will), it will be up to the payment handler (e.g., basic-card) to control this. In which case, we can implement showing multiple payment sheets and no longer in violation of the spec.
I've added a note to the show() page saying that browsers may not follow the spec on this, but more importantly, I'm subscribed to that PR so that if/when it's accepted, I can update the docs accordingly.
QA Whiteboard: qa-not-actionable

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --
You need to log in before you can comment on or make changes to this bug.