Class DefaultConnection
The default implementation for the connection interface. Supports Pooling, and is thread safe.
Inherited Members
Namespace: Ingenico.Connect.Sdk.DefaultImpl
Assembly: connect-sdk-dotnet.dll
Syntax
public class DefaultConnection : IPooledConnection, IConnection, IDisposable, ILoggingCapable, IObfuscationCapable
Constructors
DefaultConnection(TimeSpan?, int, Proxy, HttpClientHandler)
Declaration
public DefaultConnection(TimeSpan? socketTimeout, int maxConnections = 2, Proxy proxy = null, HttpClientHandler httpClientHandler = null)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan? | socketTimeout | |
int | maxConnections | |
Proxy | proxy | |
HttpClientHandler | httpClientHandler |
Properties
BodyObfuscator
The current non-null body obfuscator to use.
Declaration
public BodyObfuscator BodyObfuscator { set; }
Property Value
Type | Description |
---|---|
BodyObfuscator |
HeaderObfuscator
The current non-null header obfuscator to use.
Declaration
public HeaderObfuscator HeaderObfuscator { set; }
Property Value
Type | Description |
---|---|
HeaderObfuscator |
Methods
CloseExpiredConnections()
Closes all expired HTTP connections.
Declaration
public void CloseExpiredConnections()
CloseIdleConnections(TimeSpan)
Closes all HTTP connections that have been idle for the specified time. This should also include all expired HTTP connections. CloseExpiredConnections()
Declaration
public void CloseIdleConnections(TimeSpan timespan)
Parameters
Type | Name | Description |
---|---|---|
TimeSpan | timespan | Idle time. |
Delete<R>(Uri, IEnumerable<IRequestHeader>, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R>)
Send a DELETE request to the Ingenico ePayments platform.
Declaration
public Task<R> Delete<R>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R> 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>, R> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<R> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
R |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Ingenico ePayments platform |
DisableLogging()
Turns off logging.
Declaration
public void DisableLogging()
Dispose()
Declaration
public void Dispose()
EnableLogging(ICommunicatorLogger)
Turns on logging using the given communicator logger.
Declaration
public void EnableLogging(ICommunicatorLogger communicatorLogger)
Parameters
Type | Name | Description |
---|---|---|
ICommunicatorLogger | communicatorLogger | The given communicator logger. |
Exceptions
Type | Condition |
---|---|
ArgumentException | If the given communicator logger is |
Get<R>(Uri, IEnumerable<IRequestHeader>, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R>)
Send a GET request to the Ingenico ePayments platform.
Declaration
public Task<R> Get<R>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R> 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>, R> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<R> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
R |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Ingenico ePayments platform |
Post<R>(Uri, IEnumerable<IRequestHeader>, MultipartFormDataObject, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R>)
Send a multipart/form-data POST request to the Ingenico ePayments 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
public Task<R> Post<R>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, MultipartFormDataObject multipart, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R> 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>, R> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<R> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
R |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Ingenico ePayments platform |
Post<R>(Uri, IEnumerable<IRequestHeader>, string, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R>)
Send a POST request to the Ingenico ePayments platform.
Declaration
public Task<R> Post<R>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, string body, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R> 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>, R> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<R> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
R |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Ingenico ePayments platform |
Put<R>(Uri, IEnumerable<IRequestHeader>, MultipartFormDataObject, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R>)
Send a multipart/form-data PUT request to the Ingenico ePayments 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
public Task<R> Put<R>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, MultipartFormDataObject multipart, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R> 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>, R> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<R> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
R |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Ingenico ePayments platform |
Put<R>(Uri, IEnumerable<IRequestHeader>, string, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R>)
Send a PUT request to the Ingenico ePayments platform.
Declaration
public Task<R> Put<R>(Uri uri, IEnumerable<IRequestHeader> requestHeaders, string body, Func<HttpStatusCode, Stream, IEnumerable<IResponseHeader>, R> 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>, R> | responseHandler | A callback that handles the stream from the response |
Returns
Type | Description |
---|---|
Task<R> | Returns the object that was returned from the callback |
Type Parameters
Name | Description |
---|---|
R |
Exceptions
Type | Condition |
---|---|
CommunicationException | when an exception occurred communicating with the Ingenico ePayments platform |