PaymentsOS returns standard HTTP status codes as part of the response to all API requests.
When an API request fails (HTTP status codes in the 4xx and 5xx range), an Error object is returned as part of the response and contains:
|The response category. See the response Category table.|
|Description of the response category.|
|More information about the error, for example, which parameter caused the error.|
However, when you get a 2xx response (i.e. authorization, charge, void, refund, capture), PaymentsOS also returns the raw response object, as it was received by the payment provider, including the following:
- AVS code
- Authorization code
- Transaction ID
- External ID
PaymentsOS already includes the mapping of the different responses into one consolidated Error object.
Test practice is to rely only on the Error object, and use the raw response for logging and debugging purposes only.