Automattic / woocommerce-payments

Accept payments via credit card. Manage transactions within WordPress.
https://wordpress.org/plugins/woocommerce-payments/
Other
174 stars 69 forks source link

Clearly communicate card declines as such #9156

Open dechov opened 3 months ago

dechov commented 3 months ago

When a card is declined, the error response from the API contains an error code of "card_declined", a decline_code, and a message describing the decline reason. We appear to just present the latter, without an explicit acknowledgement of the initial fact that the card was declined. It might be acceptable to keep it implicit in most cases, since certain common scenarios would be understood to describe declines:

Front-end (shopper-facing):

card-declined-shopper-message

Admin (merchant-facing):

card-declined-merchant-message

However, some messages (codes listed here) are more ambiguous, such as "Invalid account" – without the context of it being a decline, it could be (and has been, anecdotally) interpreted as something more to do with the merchant account, and it could be helpful to prefix the message to suit this particular "card_declined" error case.

dechov commented 3 months ago

https://github.com/Automattic/woocommerce-payments/issues/8642 is related – it don't think we currently show a generic decline message, except perhaps in the case of the "generic_decline" decline_code, but that seller_message from the charge outcome might be helpful to display.