Getting alot of Generic Decline errors

Hello, we have implemented square payments on a custom e-commerce application with typescript and django, but I have noticed a lot more generic decline errors than what we had when we were on WordPress.

Does anyone have any insight to why this is happening?

Here is an example of one I recently received

{‘error’: {‘message’: ‘Square payment failed’, ‘code’: ‘BAD_REQUEST’, ‘error’: ‘{“errors”: [{“code”: “GENERIC_DECLINE”, “detail”: “Authorization error: 'GENERIC_DECLINE'”, “category”: “PAYMENT_METHOD_ERROR”}], “payment”: {“id”: “fJtooghbGsTv0f8BlfMD1JE0fpUZY”, “created_at”: “2024-03-29T05:00:43.450Z”, “updated_at”: “2024-03-29T05:00:43.922Z”, “amount_money”: {“amount”: 7191, “currency”: “USD”}, “status”: “FAILED”, “delay_duration”: “PT168H”, “source_type”: “CARD”, “card_details”: {“status”: “FAILED”, “card”: {“card_brand”: “MASTERCARD”, “last_4”: “9242”, “exp_month”: 7, “exp_year”: 2028, “fingerprint”: “sq-1-HYH6gdfV-k6R8PoOJE_dh_EsvtllG113u3YaB90AZYX9znZLfFtoBri_ZoTKdH46mA”, “card_type”: “DEBIT”, “prepaid_type”: “NOT_PREPAID”, “bin”: “517546”}, “entry_method”: “ON_FILE”, “cvv_status”: “CVV_NOT_CHECKED”, “avs_status”: “AVS_ACCEPTED”, “errors”: [{“code”: “GENERIC_DECLINE”, “detail”: “Authorization error: 'GENERIC_DECLINE'”, “category”: “PAYMENT_METHOD_ERROR”}], “statement_description”: “SQ *SUGARMDS”, “card_payment_timeline”: {“authorized_at”: “2024-03-29T05:00:43.922Z”}}, “location_id”: “FS5KRAMXNX6CR”, “order_id”: “AjW3O7Yh2UMjk6l8QSqK21DJyxJZY”, “reference_id”: “106470”, “customer_id”: “G1V7KMVCCTGFD6HHGHSVXVYG14”, “total_money”: {“amount”: 7191, “currency”: “USD”}, “approved_money”: {“amount”: 0, “currency”: “USD”}, “delay_action”: “CANCEL”, “delayed_until”: “2024-04-05T05:00:43.450Z”, “application_details”: {“square_product”: “ECOMMERCE_API”, “application_id”: “sq0idp-poEEBAE4MeOqlsG9QpfisQ”}, “version_token”: “QTC1FCm5r0EPjMHck2ZLIKZsKMlF2YNQLezWcEvQ10B6o”}}’}}

:wave: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

https://developer.squareup.com/docs/build-basics/general-considerations/handling-errors

Additional Documentation

Troubleshoot the Payments API
Web Payments SDK Requirements
Payments Requirements

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

The error code “GENERIC_DECLINE” is returned when the card-issuing bank declines the payment. This can happen for a variety of reasons, such as insufficient funds, incorrect card details, or suspicious activity detected by the bank. It’s important to note that the exact reason for the decline is not provided to Square or to the merchant for privacy and security reasons.

In your case, it seems like the card details were stored on file and used for the payment. If you’re seeing an increase in these errors, it might be due to the cards on file being outdated or no longer valid. You might want to prompt your customers to update their card information regularly to avoid such issues.

Also, it’s worth noting that the CVV status in your error message is “CVV_NOT_CHECKED”. This means that the CVV was not provided when the card was stored on file or the payment was processed. Including the CVV can often help in reducing payment declines.

Remember, the ultimate decision on whether to approve or decline a transaction is made by the card-issuing bank, so it might be helpful for the customer to contact their bank for more information if they’re seeing consistent declines.

This answer was reviewed by @Bryan-Square.