Re: [w3c/payment-request] Fine-grained error reporting with canMakePayment() (#847)

> * An error message (e.g., "okToUseAPI") that indicates that the user does not want to share detailed information but would like to use the API under show() conditions would reveal some information about the user's browser configuration.

After thinking about this more, let's not add this state for `canMakePayment`, because it seems to be equivalent to `canMakePayment` returning `true` in the current version of the spec: `true` should be returned when a payment handler is available regardless of presence of any instruments in the payment handler. If there're no payment handlers available, then `show()` would be rejected with `NotSupportedError`, which means it's not "ok to use API."

Personally, I would be OK to not add this feature to `hasEnrolledInstrument` either and allow browsers to always return the same value as `canMakePayment` regardless of user wallet contents. However, if the group consensus is to be more granular here, then we can add this state to `hasEnrolledInstrument` as "NotAllowedError: User has turned off sharing this information."

> * Errors in SSL. For example, self-signed SSL causes Chrome to always return "false" to canMakePayment() and reject show() with "AbortError: Request cancelled."

After version 1 is finished, let's discuss a `getCannotMakePaymentReason()` method .

> * Reasons why the payment sheet closed, e.g., "AbortError: User closed the payment handler", "AbortError: The payment handler cancelled the transaction", or "AbortError: User closed the card CVV entry form."

Let's _recommend_ to be specific with error messages without requiring all browsers to use the same error message text. The error codes (e.g., AbortError) are normative, but the error messages (e.g., "Request cancelled") are informative.

> I propose that we take up these use cases after version 1.

Agreed.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/847#issuecomment-471020525

Received on Friday, 8 March 2019 18:03:56 UTC