Class AdyenErrors
java.lang.Object
org.machanism.macha.core.entities.payment.Errors
org.machanism.macha.core.adapters.adyen.payment.model.AdyenErrors
The
AdyenErrors
class extends the Errors
class
to handle validation errors from Adyen's API.
This class parses exceptions, specifically ApiException
instances,
to extract meaningful validation errors like error codes and messages
and wraps them in ValidationError
objects.
For other exceptions, a general error is created.
-
Field Summary
Fields inherited from class org.machanism.macha.core.entities.payment.Errors
GENERAL_ERROR_CODE
-
Constructor Summary
ConstructorsConstructorDescriptionAdyenErrors
(Exception exception) Instantiates a newAdyenErrors
object and extracts validation errors from the provided exception. -
Method Summary
Methods inherited from class org.machanism.macha.core.entities.payment.Errors
addError, getValidationErrors, setValidationErrors, toString
-
Constructor Details
-
AdyenErrors
Instantiates a newAdyenErrors
object and extracts validation errors from the provided exception.The class checks if the exception is an
ApiException
from the Adyen API. If it is, it processes theApiError
object to extract error code and message. For other exceptions, a general validation error is added instead.- Parameters:
exception
- the exception that triggered this error handling process. Typically, this will be an instance ofApiException
.
-