-
Notifications
You must be signed in to change notification settings - Fork 20
Behavior when method-specific data is invalid #20
Comments
Seems like throwing is the right call to me. We should probably clearly define that behavior. @adrianba thoughts? |
@marcoscaceres opinion would also be good to hear. |
Yeah, it will throw. The IDL binding layer will cause it to throw automagically with a TypeError. |
Wait, sorry, I misread the code (though the second supportedNetworks was a new entry). |
Got confused, because Looking at the right spec now: Yes, it will throw... but |
I propose we update the basic-card spec like with this phrasing:
For PaymentRequest spec:
I'm using MAY instead of MUST because throwing works only for built-in payment methods, where user agent knows the format beforehand. Today that's |
@adrianba thoughts? |
Ping... |
This is part of w3c/payment-method-basic-card#20. What remains is for the basic-card specification to define its validate payment method data algorithm.
In combination with w3c/payment-request#381, this fixes w3c#20.
@domenic: Did we come to a conclusion of whether invalid |
I believe the conclusion was that it should not. The data needs to be serialized and sent to the payment app, which then is responsible for validating and processing it. |
Excellent, thank you. |
This follows w3c/payment-request#382 so that instead of simply defining the dictionaries in this spec, we say how they are used, and how invalid incoming data is processed. (See w3c#20.)
If someone writes this:
Should the constructor throw, because
supportedNetworks
must be a list according to this spec? The alternative is to pass this information to the payment app as-is and let it decide what to do with it. If we pass to the app, it would be great to clearly define the expected behavior for invalid method-specific data.The text was updated successfully, but these errors were encountered: