Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type definition for error codes and messages #1420

Open
lukehedger opened this issue Oct 23, 2024 · 1 comment
Open

Type definition for error codes and messages #1420

lukehedger opened this issue Oct 23, 2024 · 1 comment

Comments

@lukehedger
Copy link

Hello - we are looking for type definitions for the API error codes and messages (as documented here)

When you make an API call to Adyen and there is an error, you will receive a response with HTTP status code different from 2xx. In this response, you get errorCode and message fields that help you diagnose and resolve the error.
All integrations can receive generic error codes. There are also error codes specific to an integration type or a payment method.

We are expecting to be able to use these type definitions to avoid hard-coding error codes as strings in our integration, like so:

Types.ApiErrorCodes.ENCRYPTED_DATA_USED_OUTSIDE_OF_VALID_TIME_PERIOD

Does this feature exist? We had a look in the existing Types library but could not find anything.

Thanks!

@localpath
Copy link

@lukehedger It's not properly exposed AFAIK. You can use this type as defined in their lib but path is somewhat internal to them and may break if they decided to change file structure one day.

You could make a copy of it but still leaves you open to being out of sync with their types one day and instanceof checks won't work for error handling I think.

HttpClientException

import HttpClientException from '@adyen/api-library/lib/src/httpClient/httpClientException';

👍 we need this type exposed properly when possible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants