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

PaymentRequest type checks (valid non-negative monetary value) #306

Closed
marcoscaceres opened this issue Nov 14, 2016 · 4 comments
Closed

Comments

@marcoscaceres
Copy link
Member

marcoscaceres commented Nov 14, 2016

The following should be combined:

If details.total.amount.value is not a valid decimal monetary value, then throw a TypeError.
If the first character of details.total.amount.value is U+002D HYPHEN-MINUS, then throw a TypeError. total must be a non-negative amount.

We should just define a "valid non-negative monetary value" as an algorithm that calls into "valid decimal monetary value".

@marcoscaceres marcoscaceres changed the title PaymentRequest type checks PaymentRequest type checks (valid non-negative currency value) Nov 14, 2016
@marcoscaceres marcoscaceres changed the title PaymentRequest type checks (valid non-negative currency value) PaymentRequest type checks (valid non-negative monetary value) Nov 14, 2016
@marcoscaceres
Copy link
Member Author

(updated the above)

@halindrome
Copy link
Contributor

I don't mind this. However, if we do this we need to ensure that the relevant prose is preserved. We often (in specs) err on the side of a well expressed algorithm at the expense of its readability by mere mortals.

@zkoch
Copy link
Contributor

zkoch commented Mar 13, 2017

@marcoscaceres is this something we want for CR?

@marcoscaceres
Copy link
Member Author

The spec if fine as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants