diff --git a/index.html b/index.html index 106a8eb9..17c23ecd 100644 --- a/index.html +++ b/index.html @@ -346,11 +346,11 @@

  • Establish the request's id:
      -
    1. If details.id - is missing, add an id member - to details and set its value to string that uniquely - identifies this payment request. It is RECOMMENDED that the - string be a If details.id is missing, add an id member to details and + set its value to string that uniquely identifies this payment + request. It is RECOMMENDED that the string be a UUID [[!RFC4122]].
    @@ -607,7 +607,7 @@

    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 @@ -680,23 +680,26 @@

    abort() method

    -

    - The abort() method may be called if the web page wishes to - tell the user agent to abort the payment request - and to tear down any user interface that might be presented. - abort() can only be called after the show() method has - been called and before this instance's [[\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 - example, if the user agent has delegated responsibility for - the request to another app. In this situation, abort() will - reject the returned Promise. -

    +
    +

    + The abort() method is called if the web page wishes to tell + the user agent to abort the payment request and + to tear down any user interface that might be shown. The + abort() can only be called after the show() method + has been called (see states) and before this + instance's [[\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 example, if the user agent has delegated responsibility + for the request to another app. In this situation, abort() + will reject the returned Promise. +

    +

    The abort() method MUST act as follows:

    @@ -741,7 +744,7 @@

    canMakePayment() method

    -

    +

    The canMakePayment() method can be used by the developer to determine if the PaymentRequest object can be used to make a payment, before they call show(). It returns a Promise @@ -802,13 +805,20 @@

    shippingAddress attribute

    - shippingAddress is populated when the user provides a shipping - address. It is null by default. When a user provides a shipping - address, the shipping address changed algorithm runs. + A PaymentRequest's shippingAddress attribute is + populated when the user provides a shipping address. It is null by + default. When a user provides a shipping address, the shipping + address changed algorithm runs.

    + +
    +

    + onshippingaddresschange attribute +

    - onshippingaddresschange is an EventHandler - for an Event named shippingaddresschange. + A PaymentRequest's onshippingaddresschange attribute is + an EventHandler for an Event named + shippingaddresschange.

    @@ -816,13 +826,20 @@

    shippingOption attribute

    - shippingOption is populated when the user chooses a shipping - option. It is null by default. When a user chooses a shipping option, - the shipping option changed algorithm runs. + A PaymentRequest's shippingOption attribute is + populated when the user chooses a shipping option. It is null by + default. When a user chooses a shipping option, the shipping + option changed algorithm runs.

    +
    +
    +

    + onshippingoptionchange attribute +

    - onshippingoptionchange is an EventHandler for - an Event named shippingoptionchange. + A PaymentRequest's onshippingoptionchange attribute is + an EventHandler for an Event named + shippingoptionchange.

    @@ -1170,6 +1187,12 @@

    This PaymentItem contains the non-negative total amount of the payment request. +

    + Algorithms in this specification that accept a + PaymentDetailsInit dictionary will throw if the + total.amount.value is a negative number. +

    @@ -1211,6 +1234,12 @@

    This PaymentItem contains the non-negative total amount. +

    + Algorithms in this specification that accept a + PaymentDetailsUpdate dictionary will throw if the + total.amount.value is a negative number. +

    @@ -1453,104 +1482,116 @@

    readonly attribute DOMString phone; }; -
    -
    +
    +

    serializer -

    -
    +

    +

    Each attribute is converted to serialized values as per [[!WEBIDL-LS]]. - -

    - country -
    -
    - This is the [[CLDR]] (Common Locale Data Repository) region code. For - example, US, GB, CN, or JP. -
    -
    - addressLine -
    -
    +

    + +
    +

    + country attribute +

    +

    + This is the [[!CLDR]] (Common Locale Data Repository) region code. + For example, US, GB, CN, or JP. +

    +
    +
    +

    + addressLine attribute +

    +

    This is the most specific part of the address. It can include, for example, a street name, a house number, apartment number, a rural delivery route, descriptive instructions, or a post office box number. -

    -
    - region -
    -
    +

    + +
    +

    + region attribute +

    +

    This is the top level administrative subdivision of the country. For example, this can be a state, a province, an oblast, or a prefecture. -

    -
    - city -
    -
    +

    + +
    +

    + city attribute +

    +

    This is the city/town portion of the address. -

    -
    - dependentLocality -
    -
    +

    + +
    +

    + dependentLocality attribute +

    +

    This is the dependent locality or sublocality within a city. For example, used for neighborhoods, boroughs, districts, or UK dependent localities. -

    -
    - postalCode -
    -
    +

    + +
    +

    + postalCode attribute +

    +

    This is the postal code or ZIP code, also known as PIN code in India. -

    -
    - sortingCode -
    -
    +

    + +
    +

    + sortingCode attribute +

    +

    This is the sorting code as used in, for example, France. -

    -
    - languageCode -
    -
    +

    + +
    +

    + languageCode attribute +

    +

    This is the BCP-47 language code for the address. It's used to determine the field separators and the order of fields when formatting the address for display. -

    -
    - organization -
    -
    +

    + +
    +

    + organization attribute +

    +

    This is the organization, firm, company, or institution at this address. -

    -
    - recipient -
    -
    +

    + +
    +

    + recipient attribute +

    +

    This is the name of the recipient or contact person. This member may, under certain circumstances, contain multiline information. For example, it might contain "care of" information. -

    -
    - phone -
    -
    +

    + +
    +

    + phone attribute +

    +

    This is the phone number of the recipient or contact person. -

    - -

    - If the requestShipping - flag was set to true in the PaymentOptions passed to the - PaymentRequest constructor, then the user agent will - populate the shippingAddress member of the - PaymentRequest and ultimately the PaymentResponse object - with the user's selected shipping address after the user has accepted - the payment. -

    +

    +

    @@ -1640,7 +1681,7 @@

    -
    +

    PaymentResponse interface

    @@ -1665,122 +1706,137 @@

    A PaymentResponse is returned when a user has selected a payment method and approved a payment request.

    -
    -
    +
    +

    serializer -

    -
    +

    +

    Each attribute is converted to serialized values as per [[!WEBIDL-LS]]. - -

    - methodName -
    -
    +

    +
    +
    +

    + methodName attribute +

    +

    The payment method identifier for the payment method - that the user selected to fulfil the transaction. - -

    - details -
    -
    + that the user selected to fulfill the transaction. +

    +
    +
    +

    + details attribute +

    +

    An object that provides a payment method specific message used by the merchant to process the transaction and determine successful fund transfer. This data is returned by the payment method specific code that satisfies the payment request. - -

    - shippingAddress -
    -
    +

    +
    +
    +

    + shippingAddress attribute +

    +

    If the requestShipping flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then shippingAddress will be the full and final shipping address chosen by the user. - -

    - shippingOption -
    -
    +

    +
    +
    +

    + shippingOption attribute +

    +

    If the requestShipping flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then shippingOption will be the - id attribute of the selected shipping option. - -

    - payerName -
    -
    + id attribute of the + selected shipping option. +

    +
    +
    +

    + payerName attribute +

    +

    If the requestPayerName flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then payerName will be the name provided by the user. - -

    - payerEmail -
    -
    +

    +
    +
    +

    + payerEmail attribute +

    +

    If the requestPayerEmail flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then payerEmail will be the email address chosen by the user. - -

    - payerPhone -
    -
    +

    +
    +
    +

    + payerPhone attribute +

    +

    If the requestPayerPhone flag was set to true in the PaymentOptions passed to the PaymentRequest constructor, then payerPhone will be the phone number chosen by the user. - -

    - requestId -
    -
    +

    +
    +
    +

    + requestId attribute +

    +

    The corresponding payment request id that spawned this payment response. - - +

    +

    complete() method

    -

    +

    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 transaction is over (and SHOULD cause any remaining user interface to be closed).

    -
    -

    - After the payment request has been accepted and the - PaymentResponse returned to the page but before the page - calls complete() the payment request user interface remains - in a pending state. At this point the user interface ought not - offer a cancel command because acceptance of the payment request - has been returned. However, if something goes wrong and the page - never calls complete() then the user interface is blocked. -

    -

    - For this reason, implementations may choose to impose a timeout for - the page to call complete(). If the timeout expires then the - implementation will behave as if complete() was called with - no arguments. -

    -
    +

    + After the payment request has been accepted and the + PaymentResponse returned to the page but before the page calls + complete() the payment request user interface remains in a + pending state. At this point the user interface ought not offer a + cancel command because acceptance of the payment request has been + returned. However, if something goes wrong and the page never calls + complete() then the user interface is blocked. +

    +

    + For this reason, implementations MAY impose a timeout for the page to + call complete(). If the timeout expires then the + implementation will behave as if complete() was called with no + arguments. +

    The complete(result) method MUST act as follows:

    @@ -1906,9 +1962,9 @@

    If the web page wishes to update the payment request then it should - call updateWith() and provide a promise that will resolve with - a PaymentDetailsUpdate dictionary containing changed values - that the user agent SHOULD present to the user. + call updateWith() and provide a PaymentDetailsUpdate + dictionary, or a promise for one, containing changed values that the + user agent SHOULD present to the user.

    The PaymentRequestUpdateEvent constructor MUST set the @@ -1918,6 +1974,12 @@

    updateWith() method

    +

    + If the web page wishes to update the payment request then it should + call updateWith() and provide a PaymentDetailsUpdate + dictionary, or a promise for one, containing changed values that + the user agent presents to the user. +

    The updateWith(detailsPromise) method MUST act as follows: