w3c / payment-request

Payment Request API
https://www.w3.org/TR/payment-request/
Other
489 stars 135 forks source link

Unknown currencySystem should throw #686

Closed marcoscaceres closed 6 years ago

marcoscaceres commented 6 years ago

We have a few instances of things relying on:

If amount.currencySystem is not "urn:iso:std:iso:4217", terminate this algorithm.

via "check and canonicalize amount" and "check and canonicalize total". However, the places that rely on the two aforementioned algorithms are expecting them to throw.

Thus, we should change the spec text to:

If amount.currencySystem is not "urn:iso:std:iso:4217", throw a TypeError.

I'm aware that we are planning on probably ejecting currencySystem from the spec, but this would allow us to test support for it properly... so this change would be for completeness.