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

Extended json de/serialization #1057

Open
Sibl-SimonBlack opened this issue Sep 5, 2024 · 0 comments
Open

Extended json de/serialization #1057

Sibl-SimonBlack opened this issue Sep 5, 2024 · 0 comments

Comments

@Sibl-SimonBlack
Copy link

Is your feature request related to a problem? Please describe.
I have a use case where I receive a Terminal API request string and I need to parse this into a SaleToPOIMessage. and I have 4 semi-issue:
1: I need to manually parse the json and map the value to the models of the SDK.
2: The MessagePayload property makes it more difficult to parse, since it has a different name than fx PaymentRequest.
3: I need to manually convert key/value pairs to Object structure defined in the SDK e.g. SaleToAcquirerData.TenderOption.
4: When serialising response I would expect the root of the json to contain the SaleToPOIResponse property, but right now the serialisation returns the children objects of SaleToPOIResponse in the root.

Describe the solution you'd like
I would like the flow to be something like this:
string incommingJson =
{ "SaleToPOIRequest": {
"MessageHeader": {...},
"PaymentRequest": {...}
}
}
var parser = new Adyen.ApiSerialization.SaleToPoiMessageSerializer();
SaleToPOIMessage msg = parser.Deserialize(incommingJson);

//...... Do Payment flow here via SDK....//
SaleToPOIResponse response; //response from Terminal
var outgoingJsonResponse = parser.Serialize(SaleToPOIResponse);

Where the outgoingJsonResponse would have the json structure like this:
{
"SaleToPOIResponse":
{
"MessageHeader": {...},
"PaymentResponse": {...}
}
}

Describe alternatives you've considered
Make some of the parsing utilities in the Adyen nuget library accessible with the "public" access modifier.

Additional context

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

1 participant