Interface IConnection
Represents a connection to the Worldline Acquiring platform server. Thread-safe.
Inherited Members
Namespace: Worldline.Acquiring.Sdk.Communication
Assembly: Worldline.Acquiring.Sdk.dll
Syntax
public interface IConnection : IDisposable, ILoggingCapable, IObfuscationCapable
Methods
Delete<T>(Uri, IEnumerable<IRequestHeader>, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a DELETE request to the Worldline Acquiring platform.
Declaration
Task<T> Delete<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Acquiring platform |
Get<T>(Uri, IEnumerable<IRequestHeader>, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a GET request to the Worldline Acquiring platform.
Declaration
Task<T> Get<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Acquiring platform |
Post<T>(Uri, IEnumerable<IRequestHeader>, string, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a POST request to the Worldline Acquiring platform.
Declaration
Task<T> Post<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, string body, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
string | body | The optional body to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Acquiring platform |
Post<T>(Uri, IEnumerable<IRequestHeader>, MultipartFormDataObject, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a multipart/form-data POST request to the Worldline Acquiring platform.
The content type of the request will be be part of the given request header list. If the connection creates its own content type, it should be multipart.getContentType(). Otherwise, authentication failures will occur.
Declaration
Task<T> Post<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, MultipartFormDataObject multipart, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
MultipartFormDataObject | multipart | The multipart/form-data request to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Acquiring platform |
Put<T>(Uri, IEnumerable<IRequestHeader>, string, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a PUT request to the Worldline Acquiring platform.
Declaration
Task<T> Put<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, string body, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
string | body | The optional body to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Acquiring platform |
Put<T>(Uri, IEnumerable<IRequestHeader>, MultipartFormDataObject, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T>)
Send a multipart/form-data PUT request to the Worldline Acquiring platform.
The content type of the request will be be part of the given request header list. If the connection creates its own content type, it should be multipart.getContentType(). Otherwise, authentication failures will occur.
Declaration
Task<T> Put<T>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, MultipartFormDataObject multipart, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> responseHandler)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to call, including any necessary query parameters. |
IEnumerable<IRequestHeader> | requestHeaders | An optional list of request headers. |
MultipartFormDataObject | multipart | The multipart/form-data request to send. |
Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, T> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<T> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
T |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Worldline Acquiring platform |