diff --git a/index.html b/index.html index 66ab471d..4f18ff32 100644 --- a/index.html +++ b/index.html @@ -384,7 +384,7 @@

  • Let request be a new PaymentRequest.
  • Store methodData into - request@[[\methodData]]. + request@[[\methodData]].

    The methodData supplied to the PaymentRequest constructor SHOULD be in the order of preference of the caller. @@ -393,11 +393,14 @@

    presenting payment methods.

  • -
  • Store details into request@[[\details]]. +
  • Store details into + request@[[\details]].
  • -
  • Store options into request@[[\options]]. +
  • Store options into + request@[[\options]].
  • -
  • Set the value request@[[\state]] to created. +
  • Set the value request@[[\state]] to + created.
  • Set the value of the shippingAddress attribute on request to null. @@ -428,9 +431,9 @@

    multiple PaymentShippingOption objects that have the same id, then set the shippingOptions field of - request@[[\details]] to an empty sequence. + request@[[\details]] to an empty sequence.

  • -
  • If request@[[\details]] contains a +
  • If request@[[\details]] contains a shippingOptions sequence and if any PaymentShippingOption in the sequence has the selected field set to true, then set @@ -438,7 +441,8 @@

    id of the last PaymentShippingOption in the sequence with selected set to true.

  • -
  • Set the value request@[[\updating]] to false. +
  • Set the value request@[[\updating]] to + false.
  • Return request.
  • @@ -464,24 +468,24 @@

  • Let request be the PaymentRequest object on which the method is called.
  • -
  • If the value of request@[[\state]] is not +
  • If the value of request@[[\state]] is not created then throw an InvalidStateError.
  • -
  • Set the value of request@[[\state]] to +
  • Set the value of request@[[\state]] to interactive.
  • Let acceptPromise be a new Promise.
  • Store acceptPromise in - request@[[\acceptPromise]]. + request@[[\acceptPromise]].
  • Return acceptPromise and asynchronously perform the remaining steps.
  • Let supportedMethods be the union of all the supportedMethods sequences from each - PaymentMethodData in the request@[[\methodData]] - sequence. + PaymentMethodData in the + request@[[\methodData]] sequence.
  • Let acceptedMethods be supportedMethods with all identifiers removed that the user agent does not accept. @@ -506,11 +510,11 @@

    to tear down any user interface that might be shown. abort can only be called after the show method has been called and before the - request@[[\acceptPromise]] has been resolved. For example, a - web page might choose to do this if the goods they are selling are - only available for a limited amount of time. If the user does not - accept the payment request within the allowed time period, then the - request will be aborted. + request@[[\acceptPromise]] has been resolved. For + example, a web page might choose to do this if the goods they are + selling are only available for a limited amount of time. If the user + does not accept the payment request within the allowed time period, + then the request will be aborted.

    A user agent might not always be able to abort a request. For @@ -526,7 +530,7 @@

  • Let request be the PaymentRequest object on which the method is called.
  • -
  • If the value of request@[[\state]] is not +
  • If the value of request@[[\state]] is not interactive then throw an InvalidStateError.
  • Let promise be a new Promise. @@ -541,11 +545,11 @@

    reject promise with InvalidStateError and abort this algorithm.

  • -
  • Set the value of the internal slot request@[[\state]] to - closed. +
  • Set the value of the internal slot + request@[[\state]] to closed.
  • -
  • Reject the promise request@[[\acceptPromise]] with an - AbortError. +
  • Reject the promise request@[[\acceptPromise]] + with an AbortError.
  • Resolve promise with undefined.
  • @@ -556,7 +560,8 @@

    State transitions

    - The internal slot [[\state]] follows the following state transitions: + The internal slot [[\state]] follows the following state + transitions:

    Transition diagram for internal slot state of a PaymentRequest object @@ -609,7 +614,7 @@

    - [[\methodData]] + [[\methodData]] The methodData supplied to the constructor. @@ -617,7 +622,7 @@

    - [[\details]] + [[\details]] The current PaymentDetails for the payment request @@ -628,7 +633,7 @@

    - [[\options]] + [[\options]] The PaymentOptions supplied to the constructor. @@ -636,7 +641,7 @@

    - [[\state]] + [[\state]] The current - [[\updating]] + [[\updating]] true is there is a pending - [[\acceptPromise]] + [[\acceptPromise]] The pending Promise created during

    The complete method is called after the user has accepted - the payment request and the [[\acceptPromise]] has been resolved. - Calling the complete method tells the user agent - that the user interaction is over (and SHOULD cause any remaining - user interface to be closed). + the payment request and the [[\acceptPromise]] has been + resolved. Calling the complete method tells the user + agent that the user interaction is over (and SHOULD cause any + remaining user interface to be closed).

    The complete method takes a string argument from the @@ -1436,10 +1441,10 @@

    1. Let promise be a new Promise.
    2. -
    3. If the value of the internal slot [[\completeCalled]] is +
    4. If the value of the internal slot [[\completeCalled]] is true, then throw an InvalidStateError.
    5. -
    6. Set the value of the internal slot [[\completeCalled]] to +
    7. Set the value of the internal slot [[\completeCalled]] to true.
    8. Return promise and asynchronously perform the remaining @@ -1473,7 +1478,7 @@

      - [[\completeCalled]] + [[\completeCalled]] true if the
    9. If [[\waitForUpdate]] is true, then throw an InvalidStateError.
    10. -
    11. If target@[[\state]] is not interactive, then - throw an InvalidStateError. +
    12. If target@[[\state]] is not + interactive, then throw an + InvalidStateError.
    13. -
    14. If target@[[\updating]] is true, then +
    15. If target@[[\updating]] is true, then throw an InvalidStateError.
    16. Set the stop propagation flag and stop immediate @@ -1625,7 +1631,7 @@

    17. Set [[\waitForUpdate]] to true.
    18. -
    19. Set target@[[\updating]] to true. +
    20. Set target@[[\updating]] to true.
    21. The user agent SHOULD disable the user interface that allows the user to accept the payment request. This is to ensure @@ -1660,10 +1666,11 @@

      remaining user interface.

    22. Set the value of the internal slot - target@[[\state]] to closed. + target@[[\state]] to closed.
    23. -
    24. Reject the promise target@[[\acceptPromise]] with - an AbortError. +
    25. Reject the promise + target@[[\acceptPromise]] with an + AbortError.
    26. Abort this algorithm.
    27. @@ -1688,8 +1695,8 @@

      monetary value and the first character of total.amount.value is NOT U+002D HYPHEN-MINUS, then copy total value to the total - field of target@[[\details]] (total MUST - be a non-negative amount). + field of target@[[\details]] + (total MUST be a non-negative amount).

    28. If details contains a displayItems value and every PaymentItem in @@ -1697,7 +1704,7 @@

      containing a valid decimal monetary value, then copy details.displayItems to the displayItems field of - target@[[\details]]. + target@[[\details]].

    29. If details contains a modifiers value, then: @@ -1718,7 +1725,7 @@

      modifiers to an empty sequence.

    30. Copy modifiers to the modifiers - field of target@[[\details]]. + field of target@[[\details]].

  • @@ -1741,11 +1748,11 @@

  • Copy shippingOptions to the shippingOptions field of - target@[[\details]]. + target@[[\details]].
  • Let newOption be null.
  • -
  • If target@[[\details]] contains a +
  • If target@[[\details]] contains a shippingOptions sequence and if any PaymentShippingOption in the sequence has the selected field set to true, then set @@ -1768,7 +1775,7 @@

  • Set [[\waitForUpdate]] to false.
  • -
  • Set target@[[\updating]] to false. +
  • Set target@[[\updating]] to false.
  • The user agent should update the user interface based on any changed values in target. The user agent SHOULD @@ -1784,9 +1791,9 @@

    Algorithms

    - When the internal slot [[\state]] of a PaymentRequest object is - set to interactive, the user agent will trigger the - following algorithms based on user interaction. + When the internal slot [[\state]] of a PaymentRequest + object is set to interactive, the user agent will + trigger the following algorithms based on user interaction.

    @@ -1849,11 +1856,11 @@

    It MUST run the following steps:

      -
    1. If the request@[[\updating]] is true, then - terminate this algorithm and take no further action. Only one update - may take place at a time. This should never occur. +
    2. If the request@[[\updating]] is true, + then terminate this algorithm and take no further action. Only one + update may take place at a time. This should never occur.
    3. -
    4. If the request@[[\state]] is not set to +
    5. If the request@[[\state]] is not set to interactive, then terminate this algorithm and take no further action. The user agent user interface should ensure that this never occurs. @@ -1880,20 +1887,21 @@

    6. Let request be the PaymentRequest object that the user is interacting with.
    7. -
    8. If the request@[[\updating]] is true, then - terminate this algorithm and take no further action. The user +
    9. If the request@[[\updating]] is true, + then terminate this algorithm and take no further action. The user agent user interface should ensure that this never occurs.
    10. -
    11. If request@[[\state]] is not interactive, then - terminate this algorithm and take no further action. The user - agent user interface should ensure that this never occurs. +
    12. If request@[[\state]] is not + interactive, then terminate this algorithm and take no + further action. The user agent user interface should ensure + that this never occurs.
    13. If the requestShipping value of - request@[[\options]] is true, then if the - shippingAddress attribute of request is - null or if the shippingOption attribute of - request is null, then terminate this - algorithm and take no further action. This should never occur. + request@[[\options]] is true, then if + the shippingAddress attribute of request is + null or if the shippingOption attribute of + request is null, then terminate this algorithm + and take no further action. This should never occur.
    14. Let response be a new PaymentResponse.
    15. @@ -1908,38 +1916,40 @@

      for each payment method.

    16. If the requestShipping value of - request@[[\options]] is true, then copy the - shippingAddress attribute of request to the + request@[[\options]] is true, then copy + the shippingAddress attribute of request to the shippingAddress attribute of response.
    17. If the requestShipping value of - request@[[\options]] is true, then copy the - shippingOption attribute of request to the + request@[[\options]] is true, then copy + the shippingOption attribute of request to the shippingOption attribute of response.
    18. If the requestPayerName value of - request@[[\options]] is true, then set the - payerName attribute of + request@[[\options]] is true, then set + the payerName attribute of response to the payer's name provided by the user.
    19. If the requestPayerEmail value of - request@[[\options]] is true, then set the - payerEmail attribute of - response to the payer's email address selected by the user. + request@[[\options]] is true, then set + the payerEmail attribute + of response to the payer's email address selected by the + user.
    20. If the requestPayerPhone value of - request@[[\options]] is true, then set the - payerPhone attribute of response to the payer's - phone number selected by the user. + request@[[\options]] is true, then set + the payerPhone attribute of response to the + payer's phone number selected by the user.
    21. -
    22. Set response@[[\completeCalled]] to false. +
    23. Set response@[[\completeCalled]] to + false.
    24. -
    25. Set request@[[\state]] to closed. +
    26. Set request@[[\state]] to closed.
    27. -
    28. Resolve the pending promise request@[[\acceptPromise]] - with response. +
    29. Resolve the pending promise + request@[[\acceptPromise]] with response.