Interface IMarshaller
Used to marshal and unmarshal Worldline Acquiring platform request and response objects to and from JSON. Thread-safe.
Namespace: Worldline.Acquiring.Sdk.Json
Assembly: Worldline.Acquiring.Sdk.dll
Syntax
public interface IMarshaller
Methods
Marshal(object)
Marshal a request object to a JSON string.
Declaration
string Marshal(object requestObject)
Parameters
Type | Name | Description |
---|---|---|
object | requestObject | The request object. |
Returns
Type | Description |
---|---|
string |
Unmarshal<T>(Stream)
Unmarshal JSON from a stream to a response object.
Declaration
T Unmarshal<T>(Stream responseJson)
Parameters
Type | Name | Description |
---|---|---|
Stream | responseJson | The stream containing a valid JSON string. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | The response type. |
Exceptions
Type | Condition |
---|---|
MarshallerSyntaxException | if the JSON is not a valid representation for an object of the given type |
Unmarshal<T>(string)
Unmarshal a JSON string to a response object.
Declaration
T Unmarshal<T>(string responseJson)
Parameters
Type | Name | Description |
---|---|---|
string | responseJson | The JSON that will be parsed. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T | The response type. |
Exceptions
Type | Condition |
---|---|
MarshallerSyntaxException | if the JSON is not a valid representation for an object of the given type |