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

Spec: move validation of some input parameters to construction time #194

Closed
stephenmcgruer opened this issue Jun 22, 2022 · 0 comments · Fixed by #195
Closed

Spec: move validation of some input parameters to construction time #194

stephenmcgruer opened this issue Jun 22, 2022 · 0 comments · Fixed by #195

Comments

@stephenmcgruer
Copy link
Collaborator

Currently, the spec does all its data validation in the steps to check if a payment can be made, which are called during show() processing (step 16.6.1). This is at odds with the actual implementation in Chrome, which validates a lot of the data during construction, not show() (e.g., see https://wpt.fyi/results/secure-payment-confirmation/constructor.https.html?label=master&label=experimental&aligned).

I believe that validating the data during construction is actually correct (or at least, useful) as it is trivial checking (e.g., If data["credentialIds"] is empty, return false.). There is actually a PaymentRequest issue tracking adding a concept for this - w3c/payment-request#976, for which I have a PR (w3c/payment-request#977) that could address it, but it needs a little TLC.

I would like us to try to get that PR landed, and then update the SPC spec to do some of the validation during construction.

@stephenmcgruer stephenmcgruer changed the title SPC spec should validate some parameters in the constructor rather than steps-to-check-if-a-payment-can-be-made Spec: move validation of some input parameters to construction time Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant