Skip to content

Commit 384b538

Browse files
Add MerchantValidationEvent.prototype.methodName (#776)
1 parent 405ff38 commit 384b538

File tree

1 file changed

+49
-17
lines changed

1 file changed

+49
-17
lines changed

index.html

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3819,10 +3819,21 @@ <h2>
38193819
[Constructor(DOMString type, optional MerchantValidationEventInit eventInitDict),
38203820
SecureContext, Exposed=Window]
38213821
interface MerchantValidationEvent : Event {
3822+
readonly attribute DOMString methodName;
38223823
readonly attribute USVString validationURL;
38233824
void complete(Promise&lt;any&gt; merchantSessionPromise);
38243825
};
38253826
</pre>
3827+
<section>
3828+
<h2>
3829+
<dfn>methodName</dfn> attribute
3830+
</h2>
3831+
<p data-link-for="MerchantValidationEventInit">
3832+
When getting, returns the value it was initialized with. See
3833+
<a>methodName</a> member of <a>MerchantValidationEventInit</a> for
3834+
more information.
3835+
</p>
3836+
</section>
38263837
<section>
38273838
<h3>
38283839
<dfn data-lt=
@@ -3842,14 +3853,10 @@ <h3>
38423853
settings object</a>’s <a data-cite=
38433854
"!html/multipage/webappapis.html#api-base-url">API base URL</a>.
38443855
</li>
3845-
<li>Let <var>input</var> be the empty string.
3846-
</li>
3847-
<li>If <var>eventInitDict</var> was passed, set <var>input</var> to
3848-
the value of <var>eventInitDict</var>["<a>validationURL</a>"].
3849-
</li>
38503856
<li data-link-for="MerchantValidationEventInit">Let
38513857
<var>validationURL</var> be the result of <a data-cite=
3852-
"!url#concept-url-parser">URL parsing</a> <var>input</var> and
3858+
"!url#concept-url-parser">URL parsing</a>
3859+
<var>eventInitDict</var>["<a>validationURL</a>"] and
38533860
<var>base</var>.
38543861
</li>
38553862
<li>If <var>validationURL</var> is failure, throw a
@@ -3858,6 +3865,17 @@ <h3>
38583865
<li>Initialize <var>event</var>.<a>validationURL</a> attribute to
38593866
<var>validationURL</var>.
38603867
</li>
3868+
<li>If <var>eventInitDict</var>["<a>methodName</a>"] is not the
3869+
empty string, run the steps to <a data-cite=
3870+
"payment-method-id#dfn-validate-a-payment-method-identifier">validate
3871+
a payment method identifier</a> with
3872+
<var>eventInitDict</var>["<a>methodName</a>"]. If it returns false,
3873+
then throw a <a>RangeError</a> exception. Optionally, inform the
3874+
developer that the payment method identifier is invalid.
3875+
</li>
3876+
<li>Initialize <var>event</var>.<a>methodName</a> attribute to
3877+
<var>eventInitDict</var>["<a>methodName</a>"].
3878+
</li>
38613879
<li>Initialize <var>event</var>.<a data-lt=
38623880
"mechvalidation.waitForUpdate">[[\waitForUpdate]]</a> to false.
38633881
</li>
@@ -3956,18 +3974,26 @@ <h3>
39563974
</h3>
39573975
<pre class="idl">
39583976
dictionary MerchantValidationEventInit : EventInit {
3977+
DOMString methodName = "";
39593978
USVString validationURL = "";
39603979
};
39613980
</pre>
3962-
<section>
3963-
<h4>
3981+
<dl>
3982+
<dt>
3983+
<dfn>methodName</dfn> member
3984+
</dt>
3985+
<dd>
3986+
A <a>payment method identifier</a> representing the <a>payment
3987+
handler</a> that is requiring <a>merchant validation</a>.
3988+
</dd>
3989+
<dt>
39643990
<dfn>validationURL</dfn> member
3965-
</h4>
3966-
<p>
3991+
</dt>
3992+
<dd>
39673993
A URL from which a developer would fetch <a>payment
39683994
handler</a>-specific verification data.
3969-
</p>
3970-
</section>
3995+
</dd>
3996+
</dl>
39713997
</section>
39723998
</section>
39733999
<section data-dfn-for="PaymentMethodChangeEvent" data-link-for=
@@ -4018,7 +4044,7 @@ <h3>
40184044
<dfn>methodName</dfn> member
40194045
</dt>
40204046
<dd>
4021-
A DOMString representing the <a>payment method identifier</a>.
4047+
A string representing the <a>payment method identifier</a>.
40224048
</dd>
40234049
<dt>
40244050
<dfn>methodDetails</dfn> member
@@ -4253,10 +4279,14 @@ <h2>
42534279
developer can fetch <a>payment handler</a>-specific verification
42544280
data.
42554281
</li>
4282+
<li>Let <var>methodName</var> be the <a>payment method identifier</a>
4283+
for the <a>payment handler</a> that is requiring <a>merchant
4284+
validation</a>.
4285+
</li>
42564286
<li>
42574287
<a>Queue a task</a> on the <a>user interaction task source</a> to
42584288
run the following steps:
4259-
<ol>
4289+
<ol data-link-for="MerchantValidationEventInit">
42604290
<li>Assert: <var>request</var>.<a>[[\updating]]</a> is false.
42614291
</li>
42624292
<li>Assert: <var>request</var>.<a>[[\state]]</a> is
@@ -4265,9 +4295,11 @@ <h2>
42654295
<li>Let <var>eventInitDict</var> be an new
42664296
<a>MerchantValidationEventInit</a> dictionary.
42674297
</li>
4268-
<li data-link-for="MerchantValidationEventInit">Set
4269-
<var>eventInitDict</var>["<a>validationURL</a>"] to
4270-
<var>validationURL</var>.
4298+
<li>Set <var>eventInitDict</var>["<a>validationURL</a>"] to <var>
4299+
validationURL</var>.
4300+
</li>
4301+
<li>Set <var>eventInitDict</var>["<a>methodName</a>"] to
4302+
<var>methodName</var>.
42714303
</li>
42724304
<li>Let <var>event</var> be the result of <a data-cite=
42734305
"dom#concept-event-constructor">constructing</a> a

0 commit comments

Comments
 (0)