From 52f97e50eb967e22fab8122a5efba8bcf728055b Mon Sep 17 00:00:00 2001
From: Ian Jacobs
Date: Thu, 15 Jul 2021 08:58:52 -0500
Subject: [PATCH 1/7] start work on updates for respec
---
index.html | 215 ++++++++++++++---------------------------------------
1 file changed, 55 insertions(+), 160 deletions(-)
diff --git a/index.html b/index.html
index 07db5bb..bc3ab99 100644
--- a/index.html
+++ b/index.html
@@ -65,7 +65,7 @@
};
-
+
This specification defines capabilities that enable Web applications to
@@ -150,7 +150,7 @@
When the merchant (or other payee) calls the
- [[payment-request]] method canMakePayment() or show()
+ [[payment-request]] method {{PaymentRequest/canMakePayment()}} or {{PaymentRequest/show()}}
(e.g., when the user pushes a button on a checkout page), the user
agent computes a list of candidate payment handlers, comparing the
payment methods accepted by the merchant with those supported by
@@ -183,7 +183,7 @@
The user agent receives a response asynchronously once the payment
handler has finished handling the request. The response becomes the
- PaymentResponse (of [[!payment-request]]).
+ {{PaymentResponse}} (of [[!payment-request]]).
@@ -206,7 +206,7 @@
The logic of a payment handler is driven by the payment methods that
- it supports. Some payment methods, such as basic-card expect
+ it supports. Some payment methods, such as [[payment-method-basic-card]] expect
little to no processing by the payment handler which simply returns
payment card details in the response. It is then the job of the payee
website to process the payment using the returned data as input.
@@ -461,7 +461,7 @@
Let registration be the {{PaymentInstrument}}'s
associated service worker registration.
- If registration has no active worker, then
+ If registration has no [=service worker registration/active worker=], then
reject a {{Promise}} with an {{"InvalidStateError"}}
{{DOMException}} and terminate these steps.
@@ -583,9 +583,8 @@
The capabilities member is a list of
payment-method-specific capabilities that this payment handler is
capable of supporting for this instrument. For example, for the
- basic-card payment method, this object will consist of an
- object with two fields: one for supportedNetworks, and
- another for supportedTypes.
+ [[payment-method-basic-card]] payment method, this object will consist of an
+ object with one field: {{BasicCardRequest/supportedNetworks}}.
@@ -890,7 +889,7 @@
Handling a CanMakePaymentEvent
- Upon receiving a PaymentRequest, the user agent MUST
+ Upon receiving a {{PaymentRequest}}, the user agent MUST
run the following steps:
@@ -962,7 +961,7 @@
Filtering of Payment Instruments
- Given a PaymentMethodData and a {{PaymentInstrument}} that
+ Given a {{PaymentMethodData}} and a {{PaymentInstrument}} that
match on payment method identifier, this algorithm returns
true
if this instrument can be used for payment:
@@ -970,22 +969,22 @@
- Let instrument be the given {{PaymentInstrument}}.
- Let methodName be the payment method identifier
- string specified in the PaymentMethodData.
+ string specified in the {{PaymentMethodData}}.
- Let methodData be the payment method specific data of
- PaymentMethodData.
+ {{PaymentMethodData}}.
- Let paymentHandlerOrigin be the origin of the
{{ServiceWorkerRegistration}} scope URL of the payment handler with
this instrument.
- - Let paymentMethodManifest be the ingested and
- parsed payment method manifest for the
+
- Let paymentMethodManifest be the [=ingest payment method manifests|ingested=] and
+ [=parsed payment method manifest|parsed=] payment method manifest for the
methodName.
- If methodName is a standardized payment method
identifier or is a URL-based payment method identifier
- with the
"*"
string supported origins in
+ with the "*"
string [=parsed payment method manifest/supported origins=] in
paymentMethodManifest, filter based on capabilities:
@@ -1006,7 +1005,7 @@
paymentHandlerOrigin, fire the CanMakePaymentEvent
in the payment handler and return the result.
- - Otherwise, if supported origins in
+
- Otherwise, if [=parsed payment method manifest/supported origins=] in
paymentMethodManifest is an ordered set of [=url/origin=]
that contains the paymentHandlerOrigin, fire the
CanMakePaymentEvent in the payment handler and return the
@@ -1077,11 +1076,10 @@
- Extension to ServiceWorkerGlobalScope
+ Extension to {{ServiceWorkerGlobalScope}}
- This specification extends the ServiceWorkerGlobalScope
- interface.
+ This specification extends the {{ServiceWorkerGlobalScope}} interface.
partial interface ServiceWorkerGlobalScope {
@@ -1165,7 +1163,7 @@
The PaymentRequestEvent represents the data and methods available to
a Payment Handler after selection by the user. The user agent
communicates a subset of data available from the
- PaymentRequest to the Payment Handler.
+ {{PaymentRequest}} to the Payment Handler.
[Exposed=ServiceWorker]
@@ -1198,10 +1196,10 @@
Returns a string that indicates the origin where a
- PaymentRequest was initialized. When a PaymentRequest
+ {{PaymentRequest}} was initialized. When a {{PaymentRequest}}
is initialized in the topOrigin, the attributes have the
same value, otherwise the attributes have different values. For
- example, when a PaymentRequest is initialized within an
+ example, when a {{PaymentRequest}} is initialized within an
iframe from an origin other than topOrigin, the value of
this attribute is the origin of the iframe. This attribute is
initialized by Handling a PaymentRequestEvent.
@@ -1213,7 +1211,7 @@
When getting, the paymentRequestId attribute returns the
- {{ PaymentRequest/[[details]] }}.id from the PaymentRequest that
+ {{ PaymentRequest/[[details]] }}.{{PaymentRequest/id}} from the {{PaymentRequest}} that
corresponds to this {{PaymentRequestEvent}}.
@@ -1222,11 +1220,11 @@
methodData attribute
- This attribute contains PaymentMethodData dictionaries
+ This attribute contains {{PaymentMethodData}} dictionaries
containing the payment method identifiers for the payment
methods that the web site accepts and any associated payment
method specific data. It is populated from the
- PaymentRequest using the MethodData Population
+ {{PaymentRequest}} using the MethodData Population
Algorithm defined below.
@@ -1236,10 +1234,10 @@
This attribute indicates the total amount being requested for
- payment. It is of type PaymentCurrencyAmount dictionary as
+ payment. It is of type {{PaymentCurrencyAmount}} dictionary as
defined in [[payment-request]], and initialized with a copy of the
- total field of the PaymentDetailsInit provided when
- the corresponding PaymentRequest object was instantiated.
+ total field of the {{PaymentDetailsInit}} provided when
+ the corresponding {{PaymentRequest}} object was instantiated.
@@ -1340,24 +1338,24 @@
- Set dataList to the newly created Sequence.
- For each item in
- PaymentRequest@[[\methodData]] in the
+ {{PaymentRequest}}@[[\methodData]] in the
corresponding payment request, perform the following steps:
- Set inData to the item under consideration.
- Set commonMethods to the set intersection of
- inData.supportedMethods and
+ inData.{{PaymentMethodData/supportedMethods}} and
registeredMethods.
- If commonMethods is empty, skip the remaining
substeps and move on to the next item (if any).
- - Create a new PaymentMethodData object.
+
- Create a new {{PaymentMethodData}} object.
- Set outData to the newly created
- PaymentMethodData.
+ {{PaymentMethodData}}.
- - Set outData.supportedMethods to a list
+
- Set outData.{{PaymentMethodData/supportedMethods}} to a list
containing the members of commonMethods.
- Set outData.data to a copy of
@@ -1395,24 +1393,24 @@
- For each item in
- PaymentRequest@[[\paymentDetails]].modifiers
+ {{PaymentRequest}}@[[\paymentDetails]].modifiers
in the corresponding payment request, perform the following steps:
- Set inModifier to the item under consideration.
- Set commonMethods to the set intersection of
- inModifier.supportedMethods and
+ inModifier.{{PaymentDetailsModifier/supportedMethods}} and
registeredMethods.
- If commonMethods is empty, skip the remaining
substeps and move on to the next item (if any).
- - Create a new PaymentDetailsModifier object.
+
- Create a new {{PaymentDetailsModifier}} object.
- Set outModifier to the newly created
- PaymentDetailsModifier.
+ {{PaymentDetailsModifier}}.
- - Set outModifier.supportedMethods to a
+
- Set outModifier.{{PaymentDetailsModifier/supportedMethods}} to a
list containing the members of commonMethods.
- Set outModifier.total to a copy of
@@ -1491,7 +1489,7 @@
Handling a PaymentRequestEvent
- Upon receiving a PaymentRequest by way of PaymentRequest.show() and
subsequent user selection of a payment instrument, the user
agent MUST run the following steps:
@@ -1545,15 +1543,15 @@
{{PaymentRequestEvent/total}}
-
- A copy of the total field on the PaymentDetailsInit from
- the corresponding PaymentRequest.
+ A copy of the total field on the {{PaymentDetailsInit}} from
+ the corresponding {{PaymentRequest}}.
-
paymentRequestId
-
- \[\[details\]\].id from the PaymentRequest.
+ {{ PaymentRequest/[[details]] }}.{{PaymentRequest/id}} from the {{PaymentRequest}}.
@@ -1561,8 +1559,7 @@
- Let registration be the this's relevant
global object's associated service worker's
- containing service worker registration.
+ [=service worker/containing service worker registration=].
- If registration’s uninstalling flag is set,
invoke Try Clear Registration with
@@ -2007,7 +2003,7 @@
}));
- [[!payment-request]] defines an ID that parties in the
+ [[!payment-request]] defines an {{PaymentRequest/id}} that parties in the
ecosystem (including payment app providers and payees) can use for
reconciliation after network or other failures.
@@ -2033,7 +2029,7 @@
creates a PaymentRequest object with URL-based payment method
identifiers, CanMakePaymentEvent will fire in registered
payment handlers from a finite number of origins: the origins of the
- payment method manifests and their supported origins. This
+ payment method manifests and their [=parsed payment method manifest/supported origins=]. This
means that a registered payment handler will know that a user has
visited a website before the user has selected that payment handler
to complete a transaction. This behavior is similar to the status quo
@@ -2222,49 +2218,6 @@
This specification relies on several other underlying specifications.
- -
- Payment Request API
-
- -
- The terms payment method,
- PaymentRequest,
- PaymentResponse,
- supportedMethods,
- PaymentCurrencyAmount,
- paymentDetailsModifier,
- paymentDetailsInit,
- paymentDetailsBase,
- PaymentMethodData,
- PaymentMethodChangeEvent,
- PaymentRequestUpdateEvent,
- ID,
- canMakePayment(),
- show(),
- updateWith(detailsPromise),
- user
- accepts the payment request algorithm, payment method
- changed algorithm, PaymentRequest
- updated algorithm, and JSON-serializable are
- defined by the Payment Request API specification
- [[!payment-request]].
-
-
ECMAScript
@@ -2275,64 +2228,6 @@
"ECMASCRIPT#sec-json.stringify">JSON.stringify are
defined by [[!ECMASCRIPT]].
- -
- Payment Method Manifest
-
- -
- The terms payment method
- manifest, ingest
- payment method manifest, parsed
- payment method manifest, and
- supported origins are defined by the Payment Method Manifest
- specification [[!payment-method-manifest]].
-
- -
- Basic Card Payment
-
- -
- The terms basic-card,
- supportedNetworks,
- and supportedTypes
- are defined in [[!payment-method-basic-card]].
-
- -
- Service Workers
-
- -
- The terms service worker,
- service worker registration, active worker,
- service
- worker client,
ServiceWorkerRegistration
,
- ServiceWorkerGlobalScope
,
- fire
- functional event, extend lifetime
- promises,pending promises
- count, containing
- service worker registration, uninstalling flag,
- Try
- Clear Registration, Try Activate,
- ExtendableEvent,
- ExtendableEventInit,
- and scope URL
- are defined in [[!SERVICE-WORKERS]].
-
@@ -1964,8 +1959,7 @@
-
Upon fulfillment or upon rejection of
- handlerResponsePromise, queue a microtask to perform the
+ handlerResponsePromise, queue a microtask to perform the
following steps:
- Decrement the |event|'s pending promises count by one.
From f9341ba1a8f9eea5cc60c3ed4475cd1ccf87dde9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20C=C3=A1ceres?=
Date: Thu, 22 Jul 2021 20:07:46 +1000
Subject: [PATCH 3/7] Fixup more things
---
index.html | 65 ++++++++++++++++++++++--------------------------------
1 file changed, 26 insertions(+), 39 deletions(-)
diff --git a/index.html b/index.html
index 03bb233..e178121 100644
--- a/index.html
+++ b/index.html
@@ -539,8 +539,7 @@
-
+
PaymentInstrument dictionary
@@ -604,7 +603,7 @@
src member
-
- The src member is used to specify the ImageObject's
+ The src member is used to specify the {{ImageObject}}'s
source. It is a URL from which the user agent can fetch the
image’s data.
@@ -613,7 +612,7 @@
-
The sizes member is used to specify the
- ImageObject's sizes. It follows the spec of sizes member
+ {{ImageObject}}'s sizes. It follows the spec of sizes member
in HTML [^link^] element, which is a string consisting of an
unordered set of unique space-separated tokens which are
[=ASCII case-insensitive=] that represents the dimensions of an
@@ -635,7 +634,7 @@
-
The type member is used to specify the
- ImageObject's MIME type. It is a hint as to the media type
+ {{ImageObject}}'s MIME type. It is a hint as to the media type
of the image. The purpose of this member is to allow a user agent
to ignore images of media types it does not support.
@@ -649,34 +648,32 @@
When this algorithm with inputImages parameter is
invoked, the user agent must run the following steps:
-
+
- Let outputImages be an empty Sequence of
ImageObject.
- For each image in inputImages:
- - If image.type
- is not a valid MIME type string or
+
- If image.{{ImageObject/type}}
+ is not a valid MIME type string or
the value of type is not a supported media format, then return
- an empty Sequence of ImageObject.
+ an empty sequence of {{ImageObject}}.
- - If image.sizes is not a valid value, then return an empty
- Sequence of ImageObject.
+
- If image.{{ImageObject.sizes}} is not a valid value, then return an empty
+ Sequence of {{ImageObject}}.
- Let url be the result of parsing
- image.src with the
+ image.{{ImageObject/src}} with the
this's relevant settings object's [=environment
settings object/api base url=].
- If url is failure, then return an empty
- Sequence of ImageObject.
+ Sequence of {{ImageObject}}.
- If url's [=url/scheme=] is not "https", then
- return an empty Sequence of ImageObject.
+ return an empty Sequence of {{ImageObject}}.
- - Set image.src
+
- Set image.{{ImageObject/src}}
to url.
- Append image to outputImages
@@ -688,7 +685,7 @@
According to the step 2.3, it is also possible to use the relative
- url for image.src. The
+ url for image.{{ImageObject/src}}. The
following examples illustrate how relative URL resolution works in
different execution contexts.
@@ -1205,7 +1202,7 @@
initialized by Handling a PaymentRequestEvent.
-
+
paymentRequestId attribute
@@ -1489,8 +1486,7 @@
Handling a PaymentRequestEvent
- Upon receiving a {{PaymentRequest}} by way of PaymentRequest.show() and
+ Upon receiving a {{PaymentRequest}} by way of {{PaymentRequest/show()}} and
subsequent user selection of a payment instrument, the user
agent MUST run the following steps:
@@ -1499,8 +1495,7 @@
corresponding to the {{PaymentInstrument}} selected by the user.
- If registration is not found, reject the {{Promise}}
- that was created by PaymentRequest.show() with an
+ that was created by {{PaymentRequest/show()}} with an
{{"InvalidStateError"}} {{DOMException}} and terminate these steps.
-
@@ -1563,8 +1558,7 @@
- If the payment handler has not provided a
PaymentHandlerResponse, reject the {{Promise}} that was
- created by PaymentRequest.show() with an
+ created by {{PaymentRequest/show()}} with an
{{"OperationError"}} {{DOMException}}.
@@ -1628,8 +1622,7 @@
Let request be the {{PaymentRequest}} that
triggered this {{PaymentRequestEvent}}.
- Let url be the result of parsing the url argument.
+ Let url be the result of [=URL Parser|parsing=] the url argument.
If the url parsing throws an exception, return a {{Promise}}
rejected with that exception.
@@ -1648,8 +1641,7 @@
If |event|.{{ PaymentRequestEvent/[[windowClient]] }} is not null, then:
- - If |event|.{{ PaymentRequestEvent/[[windowClient]] }}.visibilityState
+
- If |event|.{{ PaymentRequestEvent/[[windowClient]] }}.{{WindowClient/visibilityState}}
is not "unloaded", reject promise with an
{{"InvalidStateError"}} {{DOMException}} and abort these steps.
@@ -1821,8 +1813,7 @@
- Letting the user try again, with the same payment handler or
with a different one.
- - Rejecting the Promise that was created by PaymentRequest.show().
+
- Rejecting the Promise that was created by {{PaymentRequest/show()}}.
@@ -1903,16 +1894,13 @@
- Validate that all required members exist in
handlerResponse and are well formed.
- - If handlerResponse.methodName is not
+
- If handlerResponse.{{PaymentHandlerResponse.methodName}} is not
present or not set to one of the values from
- |event|.methodData, run the
+ |event|.{{PaymentRequestEvent.methodData}}, run the
payment app failure algorithm and terminate these
steps.
- - If handlerResponse.details is not present
+
- If handlerResponse.{{PaymentHandlerResponse.details}} is not present
or not JSON-serializable, run the payment app
failure algorithm and terminate these steps.
@@ -1924,8 +1912,7 @@
- For each memberin
handlerResponseLet serializeMemberbe
- the result of StructuredSerializewith
+ the result of [=StructuredSerialize=] with
handlerResponse.member. Rethrow any
exceptions.
From cd6db8a1c7e39c21c295f0d4afed7bb2cfaa1488 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20C=C3=A1ceres?=
Date: Thu, 22 Jul 2021 20:09:19 +1000
Subject: [PATCH 4/7] Fixup more things
---
index.html | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index e178121..efd3364 100644
--- a/index.html
+++ b/index.html
@@ -556,7 +556,7 @@
name member
-
- The name member is a string that represents the label for
+ The {{PaymentInstrument/name}} member is a string that represents the label for
this {{PaymentInstrument}} as it is usually displayed to the
user.
@@ -564,7 +564,7 @@
icons member
-
- The icons member is an array of image objects that can
+ The {{PaymentInstrument/icons}} member is an array of image objects that can
serve as iconic representations of the payment instrument when
presented to the user for selection.
@@ -572,14 +572,14 @@
method member
-
- The method member is the payment method identifier
+ The {{PaymentInstrument/method}} member is the payment method identifier
of the payment method supported by this instrument.
-
capabilities member
-
- The capabilities member is a list of
+ The {{PaymentInstrument/capabilities}} member is a list of
payment-method-specific capabilities that this payment handler is
capable of supporting for this instrument. For example, for the
[[payment-method-basic-card]] payment method, this object will consist of an
From efa5c45d37c8f4e2c002fc316d827b669887054f Mon Sep 17 00:00:00 2001
From: Ian Jacobs
Date: Thu, 22 Jul 2021 07:17:39 -0500
Subject: [PATCH 5/7] more fixes for respec (removed payment method)
---
index.html | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/index.html b/index.html
index efd3364..a7c3691 100644
--- a/index.html
+++ b/index.html
@@ -573,7 +573,7 @@
-
The {{PaymentInstrument/method}} member is the payment method identifier
- of the payment method supported by this instrument.
+ of the payment method supported by this instrument.
-
capabilities member
@@ -1218,9 +1218,9 @@
This attribute contains {{PaymentMethodData}} dictionaries
- containing the payment method identifiers for the payment
- methods that the web site accepts and any associated payment
- method specific data. It is populated from the
+ containing the payment method identifiers for the payment
+ methods that the web site accepts and any associated payment
+ method specific data. It is populated from the
{{PaymentRequest}} using the MethodData Population
Algorithm defined below.
@@ -1781,7 +1781,7 @@
methodName attribute
- The payment method identifier for the payment method
+ The payment method identifier for the payment method
that the user selected to fulfil the transaction.
@@ -1790,8 +1790,8 @@
details attribute
- A JSON-serializable object that provides a payment
- method specific message used by the merchant to process the
+ A JSON-serializable object that provides a payment
+ method specific message used by the merchant to process the
transaction and determine successful fund transfer.
From 805c97d9778509fc0cf8ecd69549c63a73c216e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20C=C3=A1ceres?=
Date: Fri, 23 Jul 2021 10:03:18 +1000
Subject: [PATCH 6/7] Fixup JSON serialize
---
index.html | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/index.html b/index.html
index a7c3691..1ed675a 100644
--- a/index.html
+++ b/index.html
@@ -1790,7 +1790,7 @@
details attribute
- A JSON-serializable object that provides a payment
+ A object that provides a payment
method specific message used by the merchant to process the
transaction and determine successful fund transfer.
@@ -1900,9 +1900,12 @@
payment app failure algorithm and terminate these
steps.
- - If handlerResponse.{{PaymentHandlerResponse.details}} is not present
- or not JSON-serializable, run the payment app
- failure algorithm and terminate these steps.
+
- If handlerResponse.{{PaymentHandlerResponse.details}} is not present,
+ run the payment app failure algorithm and terminate these steps.
+
+ -
+ Try to [=JSON-serialize=] handlerResponse.{{PaymentHandlerResponse.details}}.
+ If it passing throws run the payment app failure algorithm and terminate these steps.
From f83c7bfe1ffffe4e3c94262ac1cabe1d9ab9eb71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marcos=20C=C3=A1ceres?=
Date: Fri, 23 Jul 2021 10:04:09 +1000
Subject: [PATCH 7/7] Wording fixup
---
index.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/index.html b/index.html
index 1ed675a..f41b0fb 100644
--- a/index.html
+++ b/index.html
@@ -1904,8 +1904,8 @@
run the payment app failure algorithm and terminate these steps.
- Try to [=JSON-serialize=] handlerResponse.{{PaymentHandlerResponse.details}}.
- If it passing throws run the payment app failure algorithm and terminate these steps.
+ Try to [=JSON-serialize=] handlerResponse.{{PaymentHandlerResponse.details}};
+ If it throws run the payment app failure algorithm and terminate these steps.