Details
Description
When adding or editing then credit card with Braintree, the same message is displayed for the user in case anything goes wrong: An error occurred, please review your CC details or try later. This can be very misleading for instance if the payment gateway is not properly set up by the provider, or the CC is rejected for some reason.
Braintree provides an extensive list of all possible errors depending on the SDK method used. We should take into consideration at least 3 scenarios: Client Create, Hosted Fields Create and Hosted Fields Tokenize error codes. [1]
Moreover we should handle 3DS-specific errors [2], namely:
- authenticate_frictionless_failed
- authenticate_unable_to_authenticate
- authenticate_rejected
- authentication_unavailable
- lookup_error
- lookup_failed_acs_error
- challenge_required
- authenticate_error
- data_only_successful
- authenticate_attempt_successful
These may or may not share the same "User friendly" error message.
References: