|
148 | 148 | method.
|
149 | 149 | li>
|
150 | 150 | 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 typedfn> |
| 157 | + dt> |
| 158 | + <dd> |
| 159 | + Optionally, an IDL type that the <a>payment methoda> 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 datadfn> |
| 167 | + dt> |
| 168 | + <dd> |
| 169 | + Algorithmic steps that specify how a <a>payment methoda> 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> |
151 | 176 | <p>
|
152 | 177 | The details of how to fulfill a payment request for a given <a>payment
|
153 | 178 | methoda> is an implementation detail of a <dfn data-export="">payment
|
|
573 | 598 | |paymentMethod|.{{PaymentMethodData/data}} into a string.
|
574 | 599 | Rethrow any exceptions.
|
575 | 600 | 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=]: |
579 | 605 | <ol>
|
580 | 606 | <li>Let |object| be the result of <a data-cite=
|
581 | 607 | "ECMASCRIPT#sec-json.parse">JSON-parsinga>
|
|
585 | 611 | <p>
|
586 | 612 | Let |idl| be the result of [=converted to an IDL
|
587 | 613 | 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. |
591 | 616 | p>
|
| 617 | + li> |
| 618 | + <li> |
592 | 619 | <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 dataa>, |
| 621 | + if any, from the specification that defines the |
| 622 | + |paymentMethod|.{{PaymentMethodData/supportedMethods}} |
| 623 | + on |object|. Rethrow any exceptions. |
597 | 624 | p>
|
598 | 625 | <p class="note">
|
599 | 626 | These step assures that any IDL type conversion and
|
|
855 | 882 | "ECMASCRIPT#sec-json.parse">JSON-parsinga> the second element
|
856 | 883 | in the |paymentMethod| tuple.
|
857 | 884 | 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}}. |
862 | 890 | li>
|
863 | 891 | <li>If conversion results in an <a>exceptiona> |error|:
|
864 | 892 | <ol>
|
|
0 commit comments