Providing helpful error messages
If a transaction fails, the AffiniPay Payment Gateway will return an error code indicating the cause of failure. We recommend mapping these error codes to more informative custom messages to create a better user experience. For example, replace “card_cvv_incorrect”, with “The CVV you provided is invalid.” The API provides a list of messages and errors.