Class OrderClient
Client that use the Order APIs.
Inherited Members
Namespace: MercadoPago.Client.Order
Assembly: MercadoPago.dll
Syntax
public class OrderClient : MercadoPagoClient<Order>
Constructors
| Edit this page View SourceOrderClient()
Initializes a new instance of the OrderClient class.
Declaration
public OrderClient()
OrderClient(IHttpClient)
Initializes a new instance of the OrderClient class.
Declaration
public OrderClient(IHttpClient httpClient)
Parameters
Type | Name | Description |
---|---|---|
IHttpClient | httpClient | The http client that will be used in HTTP requests. |
OrderClient(IHttpClient, ISerializer)
Initializes a new instance of the OrderClient class.
Declaration
public OrderClient(IHttpClient httpClient, ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
IHttpClient | httpClient | The http client that will be used in HTTP requests. |
ISerializer | serializer | The serializer that will be used to serialize the HTTP requests content and to deserialize the HTTP response content. |
OrderClient(ISerializer)
Initializes a new instance of the OrderClient class.
Declaration
public OrderClient(ISerializer serializer)
Parameters
Type | Name | Description |
---|---|---|
ISerializer | serializer | The serializer that will be used to serialize the HTTP requests content and to deserialize the HTTP response content. |
Methods
| Edit this page View SourceCancel(string, RequestOptions)
Cancel a order.
Declaration
public Order Cancel(string id, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
Order | The canceled order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
CancelAsync(string, RequestOptions, CancellationToken)
Cancel a order as an asynchronous operation.
Declaration
public Task<Order> CancelAsync(string id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<Order> | A task whose the result is the canceled order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Capture(string, RequestOptions)
Capture a order.
Declaration
public Order Capture(string id, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
Order | The captured order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
CaptureAsync(string, RequestOptions, CancellationToken)
Capture a order as an asynchronous operation.
Declaration
public Task<Order> CaptureAsync(string id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<Order> | A task whose the result is the captured order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Create(OrderCreateRequest, RequestOptions)
Creates a order.
Declaration
public Order Create(OrderCreateRequest request, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
OrderCreateRequest | request | The data to create a order. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
Order | The created order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
CreateAsync(OrderCreateRequest, RequestOptions, CancellationToken)
Creates a order as an asynchronous operation.
Declaration
public Task<Order> CreateAsync(OrderCreateRequest request, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
OrderCreateRequest | request | The data to create a order. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<Order> | A task whose the result is the created order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
CreateTransaction(string, OrderTransactionRequest, RequestOptions)
Create a transaction.
Declaration
public OrderTransaction CreateTransaction(string id, OrderTransactionRequest request, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
OrderTransactionRequest | request | The order transaction. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
OrderTransaction | The created transaction. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
CreateTransactionAsync(string, OrderTransactionRequest, RequestOptions, CancellationToken)
Create a transaction as an asynchronous operation.
Declaration
public Task<OrderTransaction> CreateTransactionAsync(string id, OrderTransactionRequest request, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
OrderTransactionRequest | request | The order transaction. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<OrderTransaction> | A task whose the result is the created transaction. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
DeleteTransaction(string, string, RequestOptions)
Delete a transaction.
Declaration
public OrderTransaction DeleteTransaction(string id, string transactionId, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
string | transactionId | The transaction id. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
OrderTransaction |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
DeleteTransactionAsync(string, string, RequestOptions, CancellationToken)
Delete a transaction as an asynchronous operation.
Declaration
public Task<OrderTransaction> DeleteTransactionAsync(string id, string transactionId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
string | transactionId | The transaction id. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<OrderTransaction> |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Get(string, RequestOptions)
Get a order.
Declaration
public Order Get(string id, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
Order | An order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
GetAsync(string, RequestOptions, CancellationToken)
Get a order as an asynchronous operation.
Declaration
public Task<Order> GetAsync(string id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<Order> | A task whose the result is an order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Process(string, RequestOptions)
Process a order.
Declaration
public Order Process(string id, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
Order | The processed order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
ProcessAsync(string, RequestOptions, CancellationToken)
Process a order as an asynchronous operation.
Declaration
public Task<Order> ProcessAsync(string id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<Order> | A task whose the result is the processed order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Refund(string, OrderRefundPaymentRequest, RequestOptions)
Refund a order or transaction.
Declaration
public Order Refund(string id, OrderRefundPaymentRequest request = null, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
OrderRefundPaymentRequest | request | The order refund. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
Order | The refunded order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
RefundAsync(string, OrderRefundPaymentRequest, RequestOptions, CancellationToken)
Refund a order or transaction as an asynchronous operation.
Declaration
public Task<Order> RefundAsync(string id, OrderRefundPaymentRequest request = null, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
OrderRefundPaymentRequest | request | The order refund. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<Order> | A task whose the result is the refunded order. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
UpdateTransaction(string, string, OrderPaymentRequest, RequestOptions)
Update a transaction.
Declaration
public OrderUpdateTransaction UpdateTransaction(string id, string transactionId, OrderPaymentRequest request, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
string | transactionId | The transaction id. |
OrderPaymentRequest | request | The order transaction. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
OrderUpdateTransaction | The updated transaction. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
UpdateTransactionAsync(string, string, OrderPaymentRequest, RequestOptions, CancellationToken)
Update a transaction as an asynchronous operation.
Declaration
public Task<OrderUpdateTransaction> UpdateTransactionAsync(string id, string transactionId, OrderPaymentRequest request, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | id | The order id. |
string | transactionId | The transaction id. |
OrderPaymentRequest | request | The order transaction. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token. |
Returns
Type | Description |
---|---|
Task<OrderUpdateTransaction> | A task whose the result is the updated transaction. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |