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

TerminalCloudAPI async response type #1439

Open
naseemkullah opened this issue Dec 18, 2024 · 6 comments
Open

TerminalCloudAPI async response type #1439

naseemkullah opened this issue Dec 18, 2024 · 6 comments
Labels
documentation Improvements or additions to documentation Fix Fix

Comments

@naseemkullah
Copy link

export const asyncRes = "ok";

While happy path does return an "ok" string, it would appear that failed requests return a payload. Could you please confirm this and adjust the return type accordingly? Thank you!

@Kwok-he-Chu
Copy link
Member

When calling the TerminalCloudApi (https://github.com/Adyen/adyen-node-api-library/blob/v23.3.0/src/services/terminalCloudAPI.ts#L55-L58) /async-endpoint, the returned response should be of type string

Could you provide a minimal example of the TerminalAPIRequest that you're trying to send, so that we can reproduce it?

@naseemkullah
Copy link
Author

Image

This response from /async endpoint has been observed when response is not ok (truncated)

@Kwok-he-Chu
Copy link
Member

Would the following work for you:

Serialize the string to a terminalApiResponse, if the response is not ok?

@naseemkullah
Copy link
Author

naseemkullah commented Jan 31, 2025

its fine as is, but what would be good is if the SDK just mentioned the response type could be "ok" | WhateverThisTypeIs so we know what to expect. this issue is raised mainly to correct the return type in the SDK, rather than change any behaviour.

@Kwok-he-Chu
Copy link
Member

That makes sense. Thank you for the feedback.

@naseemkullah
Copy link
Author

np! seems like its SaleToPOIRequest though you probably know that already :)

heres what it looks like devex wise

Image

@Kwok-he-Chu Kwok-he-Chu added documentation Improvements or additions to documentation Fix Fix and removed needs response labels Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Fix Fix
Projects
None yet
Development

No branches or pull requests

2 participants