Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MerchantValidationEvent.prototype.methodName #776

Merged
merged 3 commits into from Sep 13, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions index.html
Expand Up @@ -3865,6 +3865,13 @@ <h3>
<li>Initialize <var>event</var>.<a>validationURL</a> attribute to
<var>validationURL</var>.
</li>
<li>Run the steps to <a data-cite=
"payment-method-id#dfn-validate-a-payment-method-identifier">validate
a payment method identifier</a> with
<var>eventInitDict</var>["<a>methodName</a>"]. If it returns false,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm always unsure how much validation we should be doing in event constructors, i.e. should they be dumb property bags that hold whatever you pass in, or should they enforce domain logic constraints. But this is good for now, and consistent.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, thought about the same. Consistency allows us to treat both implementers and user-land code as potentially invalid, which I think is a good thing.

then throw a <a>RangeError</a> exception. Optionally, inform the
developer that the payment method identifier is invalid.
</li>
<li>Initialize <var>event</var>.<a>methodName</a> attribute to
<var>eventInitDict</var>["<a>methodName</a>"].
</li>
Expand Down