cancel
Showing results for 
Search instead for 
Did you mean: 

How to Handle Declined Transactions with Specific Response Codes?

 

Hi Cybersource Community,

I’m integrating Cybersource’s payment gateway into my application, and I need help handling declined transactions based on specific response codes.

Currently, when a transaction is declined, the API returns a response with a code and message, but I’m unsure about the best practices for:

  1. Differentiating between soft declines (e.g., insufficient funds) and hard declines (e.g., invalid card number).
  2. Implementing retries for soft declines without violating compliance standards.
  3. Displaying user-friendly error messages while keeping sensitive details secure.

    Here’s a sample of my current implementation:

     

    json
    Copy code
    { "responseCode": "203", "responseMessage": "General decline of the card." }
     

    Questions:

    • Is there a definitive list of response codes categorized by soft vs. hard declines?
    • Are there recommended retry strategies for certain codes?
    • How can I customize error handling for different codes effectively?

      Any guidance, code examples, or documentation references would be greatly appreciated!

      Thank you in advance for your help.

miasmith11
New Member
0 REPLIES 0