diff --git a/index.html b/index.html index 77093d67..adba0af0 100644 --- a/index.html +++ b/index.html @@ -387,22 +387,46 @@

PaymentRequest constructor

TypeError.
  • - If details contains a value for error, then throw a + If details.total.amount.value is not a valid decimal monetary value, then throw a TypeError.
  • If the first character of details.total.amount.value is U+002D HYPHEN-MINUS, then throw a TypeError. total MUST be a non-negative amount.
  • +
  • + If the details.displayItems sequence contains any PaymentItem + objects with an amount that is not a valid decimal monetary value, then throw a + TypeError. +
  • +
  • + If the details.shippingOptions sequence contains any PaymentShippingOption + objects with an amount that is not a valid decimal monetary value, then throw a + TypeError. +
  • +
  • + If details contains a value for error, then throw a + TypeError. +
  • For each PaymentMethodData in methodData, if the data field is supplied but is not a JSON-serializable object, then throw a TypeError.
  • +
  • + For each PaymentDetailsModifier in details.modifiers, if the total field + is supplied and is not a valid decimal monetary value, then throw a TypeError. +
  • For each PaymentDetailsModifier in details.modifiers, if the total field is supplied and the first character of total.amount.value is U+002D HYPHEN-MINUS, then throw a TypeError. total MUST be a non-negative amount.
  • +
  • + For each PaymentDetailsModifier in details.modifiers, if the + additionalDisplayItems sequence contains any PaymentItem + objects with an amount that is not a valid decimal monetary value, then throw a + TypeError. +
  • Let request be a new PaymentRequest.
  • Store methodData into request@[[\methodData]]. @@ -648,12 +672,18 @@

    PaymentCurrencyAmount

    value
    - A string containing the decimal monetary value. If a decimal separator is needed, then the string - MUST use a single U+002E FULL STOP character as the decimal separator. The string MUST begin - with a single U+002D HYPHEN-MINUS character if the value is negative. All other characters must - be characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9). + A valid decimal monetary value containing a monetary amount. A string is a valid + decimal monetary value if it consists of the following components in the given order: +
      +
    1. Optionally, a single U+002D HYPHEN-MINUS character (-), to indicate that the amount is + negative
    2. +
    3. One or more characters in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9)
    4. +
    5. Optionally, a single U+002E FULL STOP character (.) followed by one or more characters in + the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9)
    6. +
    - The string matches the regular expression ^-?[0-9]+(\.[0-9]+)?$. + The following regular expression is an implementation of the above definition. +
    ^-?[0-9]+(\.[0-9]+)?$
    @@ -1193,29 +1223,48 @@

    updateWith()

    PaymentDetails dictionary, then:
    1. - If details contains a total value and the first character of + If details contains a total value and total.amount.value + is a valid decimal 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).
    2. - If details contains a displayItems value, then copy - this value to the displayItems field of target@[[\details]]. + If details contains a displayItems value and every + PaymentItem in the displayItems has an + amount.value containing a valid decimal monetary value, + then copy details.displayItems to the displayItems + field of target@[[\details]].
    3. - If details contains a modifiers value, then copy - this value to the modifiers field of target@[[\details]]. + If details contains a modifiers value, then: +
        +
      1. Let modifiers be the sequence details.modifiers.
      2. +
      3. For each PaymentDetailsModifier in modifiers, if the + total field is supplied and is not a valid decimal monetary value, + then set modifiers to an empty sequence.
      4. +
      5. For each PaymentDetailsModifier in modifiers, if the + additionalDisplayItems sequence contains any PaymentItem + objects with an amount that is not a valid decimal monetary value, + then set modifiers to an empty sequence.
      6. +
      7. Copy modifiers to the modifiers field of target@[[\details]].
      8. +
    4. If details contains a shippingOptions sequence, then:
        +
      1. Let shippingOptions be the sequence details.shippingOptions.
      2. - If the details.shippingOptions sequence contains multiple + If the shippingOptions sequence contains multiple PaymentShippingOption objects that have the same id, - then set the shippingOptions field of request@[[\details]] - to an empty sequence. - Otherwise copy the shippingOptions sequence from details to the - shippingOptions field of target@[[\details]]. + then set shippingOptions to the empty sequence.
      3. +
      4. + If the shippingOptions sequence contains a PaymentShippingOption + that has an amount.value that is not a valid decimal monetary value, + then set shippingOptions to the empty sequence.
      5. +
      6. + Copy shippingOptions to the shippingOptions field of + target@[[\details]].
      7. Let newOption be null.