Overview
When developing applications that interact with Jupico’s server, it’s crucial to implement robust error handling strategies.
Error responses typically fall into different categories based on HTTP status codes, and handling them appropriately ensures smooth and secure application functionality. This section outlines the strategies for managing various error responses.

[HTTP 200s] - User Interface Error Handling
Upon receiving an HTTP 200 response code, the web application determines the appropriate user interface action based on the response.success
field. This field guides whether to display a success notification (e.g., “Successful payment”) or an error message.
A response with an HTTP status of 200 but marked as success=false
is categorized as an error, suitable for direct presentation in the user interface. Jupico consistently crafts error messages to be industry-agnostic, ensuring their compatibility with user interface display.

[HTTP 400s & 500s] - Server Side Error Handling
HTTP 400s - Coding or Authorization Issues
Upon the Application Server’s receipt of an HTTP 400 response code, this signifies a coding or logical error within the application server. Developers should implement a try/catch block to capture these exceptions.
Following this, the response should be managed according to the specific error code encountered. It is imperative to handle these errors on the server side and ensure that neither the error.code nor the error.message are transmitted to the web application’s user interface, as they may contain sensitive information relevant to security.

HTTP 500 - Internal Server Errors
Receiving an HTTP 500 response code is rare and indicates a problem within Jupico’s server infrastructure. In these instances, the recommended initial action is toinitiate areversal operation (rollback).
If the issue continues, contacting technical support for additional assistance is advisable. This procedure aims to facilitate swift resolution and reduce potential effects on system functionality and user experience.

HTTP 503 - Service Unavailable
An HTTP 503 status code signifies that one or more external services on the server are temporarily unavailable. Under these circumstances, retrying the operation is recommended.
Unlike other errors, reversing the previous action is not required in this case. It is important to patiently retry the request, as the issue is frequently resolved once the external services return to full functionality.
