diff --git a/index.html b/index.html index b954e85..0940073 100644 --- a/index.html +++ b/index.html @@ -967,33 +967,47 @@

  • If registration is not found, terminate these steps.
  • -
  • Invoke the handle functional event algorithm with a - ServiceWorkerRegistration of registration and - callbackSteps set to the following steps: -
      -
    1. Set global to the global object that was provided - as an argument. -
    2. -
    3. Create a trusted event, e, that uses the - CanMakePaymentEvent interface, with the event type - canmakepayment, which does not bubble, cannot be canceled, and - has no default action. -
    4. -
    5. Set the topOrigin, - paymentRequestOrigin, - methodData, and - modifiers - attributes of e the same way as when handling - PaymentRequestEvent. -
    6. -
    7. Dispatch e to global. -
    8. -
    9. Wait for all of the promises in the extend lifetime - promises of e to resolve. -
    10. -
    +
  • +

    + Fire Functional Event "canmakepayment" using + CanMakePaymentEvent on registration with the + following properties: +

    +
    +
    topOrigin
    +
    the serialization of the + origin of the top level payee web page.
    +
    paymentRequestOrigin +
    +
    the serialization of the + origin of the context where PaymentRequest was initialized. +
    +
    paymentRequestId
    +
    The [[\details]].id from the PaymentRequest
    +
    methodData +
    +
    The result of executing the MethodData Population + Algorithm
    +
    modifiers +
    +
    The result of executing the Modifiers Population + Algorithm
    +
    total +
    +
    A structured clone of the total field on the + PaymentDetailsInit from the corresponding + PaymentRequest.
    +
    instrumentKey +
    +
    The instrumentKey of the selected + PaymentInstrument, or the empty string if none was + selected.
    +
  • @@ -1500,56 +1514,54 @@

    "InvalidStateError" DOMException and terminate these steps. -
  • Invoke the handle functional event algorithm with a - ServiceWorkerRegistration of registration and - callbackSteps set to the following steps: -
      -
    1. Set global to the global object that was provided - as an argument. -
    2. -
    3. Create a trusted event, e, that uses the - PaymentRequestEvent interface, with the event type - paymentrequest, which does not bubble, cannot be canceled, - and has no default action. -
    4. -
    5. Set the topOrigin attribute - of e to +

      + Fire Functional Event "paymentrequest" using + PaymentRequestEvent on registration with the + following properties: +

      +
      +
      topOrigin
      +
      the serialization of the - origin of the top level payee web page. -
    6. -
    7. Set the of the top level payee web page. +
      paymentRequestOrigin - attribute of e to +
      the serialization of the origin of the context where PaymentRequest was initialized. -
    8. -
    9. Set the paymentRequestId - attribute of e to the [[\details]].id from the - PaymentRequest. -
    10. -
    11. Set the methodData and modifiers attributes of - e by executing the MethodData Population Algorithm - and Modifiers Population Algorithm respectively. -
    12. -
    13. Set the total - attribute of e to a structured clone of the - total field on the PaymentDetailsInit from the - corresponding PaymentRequest. -
    14. -
    15. Set the instrumentKey attribute - of e to the instrumentKey of the selected + +
      paymentRequestId
      +
      The [[\details]].id from the PaymentRequest
      +
      methodData +
      +
      The result of executing the MethodData Population + Algorithm
      +
      modifiers +
      +
      The result of executing the Modifiers Population + Algorithm
      +
      total +
      +
      A structured clone of the total field on the + PaymentDetailsInit from the corresponding + PaymentRequest.
      +
      instrumentKey +
      +
      The instrumentKey of the selected PaymentInstrument, or the empty string if none was - selected. -
    16. -
    17. Dispatch e to global. -
    18. + selected. + +

      + Then run the following steps in parallel, with + dispatchedEvent: +

      +
      1. Wait for all of the promises in the extend lifetime - promises of e to resolve. + promises of dispatchedEvent to resolve.
      2. If the payment handler has not provided a PaymentHandlerResponse, reject the Promise that was @@ -2268,8 +2280,8 @@

        ServiceWorkerGlobalScope, handle - functional event, fire functional + event, extend lifetime promises,pending promises