Closed Bug 1429213 Opened 3 years ago Closed 3 years ago

Implement the "unknown"/timeout screen for when the merchant rejects the payment and doesn't request retrying

Categories

(Firefox :: WebPayments UI, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 61
Tracking Status
firefox61 --- fixed

People

(Reporter: MattN, Assigned: jaws)

References

()

Details

(Whiteboard: [webpayments])

Attachments

(1 file, 1 obsolete file)

After sending the PaymentResponse to the merchant via the DOM code, the merchant should respond to indicate if the payment was accepted or rejected. If the merchant calls `PaymentResponse.complete` with the argument "unknown" or `complete` isn't called within a reasonable time, a generic final message should be shown before the dialog closes.

> "unknown"
>    The developer did not indicate success or failure and the user agent SHOULD NOT display UI indicating success or failure.
Priority: P3 → P1
Assignee: nobody → jaws
Status: NEW → ASSIGNED
Until we have bug 1441683 fixed, I'll just implement this bug showing the "unknown" state on the button. We can use bug 1441683 or a follow-up to implement the timeout.
Why do we need bug 1441683 to handle the timeout case since we know when complete is called?
Flags: needinfo?(jaws)
Yeah, we could do it here. I had been thinking of waiting until we got the completeStatus since merchants can't effectively use the completeStatus argument yet anyways, but .complete() and .complete("unknown") act the same so I can do it here.
Flags: needinfo?(jaws)
Comment on attachment 8954895 [details]
Bug 1429213 - Time out the payment dialog after the user clicks 'Pay', closing the dialog if response.complete() is not called.

https://reviewboard.mozilla.org/r/224060/#review230576

Can you split the timeout stuff to a separate commit? It's easier to review and matches the commit message. r+ on revision 1 that just had unknown. It should be easy to recreate from the revision 1 commit.
Comment on attachment 8954895 [details]
Bug 1429213 - Time out the payment dialog after the user clicks 'Pay', closing the dialog if response.complete() is not called.

https://reviewboard.mozilla.org/r/224060/#review230584

::: toolkit/components/payments/paymentUIService.js:70
(Diff revision 3)
>    completePayment(requestId) {
>      this.log.debug("completePayment:", requestId);
> +    let dialog = this.findDialog(requestId);
> +    if (dialog && dialog.unknownTimeoutId) {
> +      dialog.clearTimeout(dialog.unknownTimeoutId);
> +    }
>      let closed = this.closeDialog(requestId);

Please add a test for this behaviour. It's easy to directly call this method in a m-bc test for now to simulate the DOM calling it.
Attachment #8954895 - Flags: review?(MattN+bmo)
Comment on attachment 8955704 [details]
Bug 1429213 - Implement the 'unknown' screen for when the merchant rejects the payment.

https://reviewboard.mozilla.org/r/224790/#review231414
Attachment #8955704 - Flags: review?(MattN+bmo) → review+
Comment on attachment 8954895 [details]
Bug 1429213 - Time out the payment dialog after the user clicks 'Pay', closing the dialog if response.complete() is not called.

https://reviewboard.mozilla.org/r/224060/#review231418

Thanks

::: toolkit/components/payments/test/browser/browser.ini:5
(Diff revision 4)
>  [DEFAULT]
>  head = head.js
>  prefs =
>    dom.payments.request.enabled=true
> +  dom.payments.unknownTimeoutMS=0

Please file a follow-up to test the timeout duration.
Attachment #8954895 - Flags: review?(MattN+bmo) → review+
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/752ad36df388
Implement the 'unknown' screen for when the merchant rejects the payment. r=MattN
https://hg.mozilla.org/integration/autoland/rev/3f419c7dcf2a
Time out the payment dialog after the user clicks 'Pay', closing the dialog if response.complete() is not called. r=MattN
Comment on attachment 8954895 [details]
Bug 1429213 - Time out the payment dialog after the user clicks 'Pay', closing the dialog if response.complete() is not called.

https://reviewboard.mozilla.org/r/224060/#review231418

> Please file a follow-up to test the timeout duration.

Filed bug 1443885.
Backout by csabou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/61ac0108bef6
Backed out 2 changesets for mochitest browser chrome failures at browser_show_dialog.js on a CLOSED TREE
Flags: needinfo?(jaws)
Whiteboard: [webpayments]
Attachment #8954895 - Attachment is obsolete: true
Pushed by jwein@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4cf36c1b89d5
Implement the 'unknown' screen for when the merchant rejects the payment. r=MattN
https://hg.mozilla.org/mozilla-central/rev/4cf36c1b89d5
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Product: Toolkit → Firefox
Target Milestone: mozilla61 → Firefox 61
You need to log in before you can comment on or make changes to this bug.