@@ -148,6 +148,31 @@ <h2>
148148 method.
149149 </ li >
150150 </ ul >
151+ < p >
152+ A payment method defines:
153+ </ p >
154+ < dl >
155+ < dt >
156+ An optional < dfn data-dfn-for ="Payment Method "> additional data type</ dfn >
157+ </ dt >
158+ < dd >
159+ Optionally, an IDL type that the < a > payment method</ a > expects
160+ to receive as the {{PaymentMethodData}}'s {{PaymentMethodData/data}}
161+ member. If not specified for a given payment method, no conversion to
162+ IDL is done and the payment method will receive
163+ {{PaymentMethodData/data}} as JSON.
164+ </ dd >
165+ < dt >
166+ < dfn > Steps to validate payment method data</ dfn >
167+ </ dt >
168+ < dd >
169+ Algorithmic steps that specify how a < a > payment method</ a > validates
170+ the {{PaymentMethodData/data}} member of the {{PaymentMethodData}},
171+ after it is converted to the payment method's
172+ [=Payment Method/additional data type=]. If not specified for a given
173+ payment method, no validation is done.
174+ </ dd >
175+ </ dl >
151176 < p >
152177 The details of how to fulfill a payment request for a given < a > payment
153178 method</ a > is an implementation detail of a < dfn data-export =""> payment
@@ -573,9 +598,10 @@ <h2>
573598 |paymentMethod|.{{PaymentMethodData/data}} into a string.
574599 Rethrow any exceptions.
575600 </ li >
576- < li > If |serializedData| is not null, and if required by the
577- specification that defines the
578- |paymentMethod|.{{PaymentMethodData/supportedMethods}}:
601+ < li > If |serializedData| is not null, and if the specification
602+ that defines the
603+ |paymentMethod|.{{PaymentMethodData/supportedMethods}}
604+ specifies an [=Payment Method/additional data type=]:
579605 < ol >
580606 < li > Let |object| be the result of < a data-cite =
581607 "ECMASCRIPT#sec-json.parse "> JSON-parsing</ a >
@@ -585,15 +611,16 @@ <h2>
585611 < p >
586612 Let |idl| be the result of [=converted to an IDL
587613 value|converting=] |object| to an IDL value of the
588- type specified by the specification that defines the
589- |paymentMethod|.{{PaymentMethodData/supportedMethods}}.
590- Rethrow any exceptions.
614+ [=Payment Method/additional data type=]. Rethrow any
615+ exceptions.
591616 </ p >
617+ </ li >
618+ < li >
592619 < p >
593- If required by the specification that defines the
594- |paymentMethod|.{{PaymentMethodData/supportedMethods}},
595- validate the members of |idl|. If a member's value is
596- invalid, throw a {{TypeError}} .
620+ Run the < a > steps to validate payment method data </ a > ,
621+ if any, from the specification that defines the
622+ |paymentMethod|.{{PaymentMethodData/supportedMethods}}
623+ on |object|. Rethrow any exceptions .
597624 </ p >
598625 < p class ="note ">
599626 These step assures that any IDL type conversion and
@@ -855,10 +882,11 @@ <h2>
855882 "ECMASCRIPT#sec-json.parse "> JSON-parsing</ a > the second element
856883 in the |paymentMethod| tuple.
857884 </ li >
858- < li > If required by the specification that defines the
859- |identifier|, then [=converted to an IDL value|convert=] |data|
860- to an IDL value of the type specified there. Otherwise,
861- [=converted to an IDL value|convert=] to {{object}}.
885+ < li > If the specification that defines the |identifier| specifies
886+ an [=Payment Method/additional data type=], then [=converted to an
887+ IDL value|convert=] |data| to an IDL value of that type.
888+ Otherwise, [=converted to an IDL value|convert=] |data| to
889+ {{object}}.
862890 </ li >
863891 < li > If conversion results in an < a > exception</ a > |error|:
864892 < ol >
0 commit comments