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:
- Differentiating between soft declines (e.g., insufficient funds) and hard declines (e.g., invalid card number).
- Implementing retries for soft declines without violating compliance standards.
- 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.