diff --git a/index.html b/index.html index 2f2de395..e82c004b 100644 --- a/index.html +++ b/index.html @@ -236,6 +236,12 @@

page to exchange information with the user agent while the user is providing input before approving or denying a payment request.

+

+ The user agent as a whole has a single payment request is + showing boolean, initially false. This is used to prevent + multiple PaymentRequests from being shown, via their + show() method, at the same time. +

The shippingAddress, shippingOption, and shippingType attributes are populated during processing if the @@ -602,14 +608,23 @@

show() method

-

- The show() method is called when the page wants to begin user - interaction for the payment request. The show() method returns - a Promise that will be resolved when the user accepts the - payment request. Some kind of user interface will be presented to - the user to facilitate the payment request after the show() - method returns. -

+
+

+ The show() method is called when the page wants to begin + user interaction for the payment request. The show() method + returns a Promise that will be resolved when the user + accepts the payment request. Some kind of user interface will + be presented to the user to facilitate the payment request after + the show() method returns. +

+

+ It is not possible to show multiple PaymentRequests at the + same time within one user agent. Calling show() if + another PaymentRequest is already showing, even due to some + other site, will return a promise rejected with an + "AbortError" DOMException. +

+

The show() method MUST act as follows:

@@ -617,17 +632,20 @@

  • Let request be the PaymentRequest object on which the method is called.
  • -
  • If the value of request.[[\state]] is not - "created" then throw an "InvalidStateError" +
  • If request.[[\state]] is not "created" + then return a promise rejected with an "InvalidStateError" DOMException.
  • -
  • Set the value of request.[[\state]] to - "interactive". +
  • If the user agent's payment request is showing + boolean is true, then return a promise rejected with an + "AbortError" DOMException. +
  • +
  • Set request.[[\state]] to "interactive".
  • Let acceptPromise be a new Promise.
  • -
  • Set acceptPromise in - request.[[\acceptPromise]]. +
  • Set request.[[\acceptPromise]] to + acceptPromise.
  • @@ -639,7 +657,7 @@

  • Set request.[[\state]] to "closed".
  • -
  • Abort this algorithm. +
  • Return acceptPromise.
  • @@ -650,6 +668,9 @@

    advantage of this step.

    +
  • Set the user agent's payment request is showing + boolean to true. +
  • Return acceptPromise and perform the remaining steps in parallel.
  • @@ -667,7 +688,8 @@

  • If this consultation produced no supported method of paying, then reject acceptPromise with a "NotSupportedError" - DOMException, and abort this algorithm. + DOMException, and set the user agent's payment + request is showing boolean to false.
  • @@ -2502,7 +2524,8 @@

    The user accepts the payment request algorithm runs when the user accepts the - payment request and confirms that they want to pay. It MUST run the + payment request and confirms that they want to pay. It MUST queue + a task on the user interaction task source to perform the following steps:

      @@ -2589,6 +2612,9 @@

    1. Set request.[[\state]] to "closed".
    2. +
    3. Set the user agent's payment request is showing + boolean to false. +
    4. Resolve the pending promise request.[[\acceptPromise]] with response. @@ -2602,8 +2628,9 @@

      The user aborts the payment request algorithm runs when the user aborts the payment - request through the currently interactive user interface. It MUST run - the following steps: + request through the currently interactive user interface. It MUST + queue a task on the user interaction task source to + perform the following steps:

      1. Let request be the PaymentRequest object that @@ -2618,17 +2645,13 @@

        further action. The user agent user interface should ensure that this never occurs.

      2. -
      3. - Queue a task on the user interaction task source to - perform the following steps: -
          -
        1. Set request.[[\state]] to "closed". -
        2. -
        3. Reject the promise - request.[[\acceptPromise]] with an - "AbortError" DOMException. -
        4. -
        +
      4. Set request.[[\state]] to "closed". +
      5. +
      6. Set the user agent's payment request is showing + boolean to false. +
      7. +
      8. Reject the promise request.[[\acceptPromise]] + with an "AbortError" DOMException.