Class CustomerCardClient
Client with methods of Customer Cards APIs.
Inherited Members
Namespace: MercadoPago.Client.Customer
Assembly: MercadoPago.dll
Syntax
public class CustomerCardClient : MercadoPagoClient<CustomerCard>
Constructors
| Edit this page View SourceCustomerCardClient()
Initializes a new instance of the CustomerCardClient class.
Declaration
public CustomerCardClient()
CustomerCardClient(IHttpClient)
Initializes a new instance of the CustomerCardClient class.
Declaration
public CustomerCardClient(IHttpClient httpClient)
Parameters
Type | Name | Description |
---|---|---|
IHttpClient | httpClient | The http client that will be used in HTTP requests. |
CustomerCardClient(IHttpClient, ISerializer)
Initializes a new instance of the CustomerCardClient class.
Declaration
public CustomerCardClient(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. |
CustomerCardClient(ISerializer)
Initializes a new instance of the CustomerCardClient class.
Declaration
public CustomerCardClient(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 SourceCreate(string, CustomerCardCreateRequest, RequestOptions)
Creates a card for customer.
Declaration
public CustomerCard Create(string customerId, CustomerCardCreateRequest request, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | Customer ID. |
CustomerCardCreateRequest | request | Request to create the card. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
CustomerCard | The created card. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
CreateAsync(string, CustomerCardCreateRequest, RequestOptions, CancellationToken)
Creates a card for customer as an asynchronous operation.
Declaration
public Task<CustomerCard> CreateAsync(string customerId, CustomerCardCreateRequest request, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | Customer ID. |
CustomerCardCreateRequest | request | Request to create the card. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<CustomerCard> | A task whose the result is the created card. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Delete(string, string, RequestOptions)
Deletes the card of the customer.
Declaration
public CustomerCard Delete(string customerId, string cardId, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | The customer ID. |
string | cardId | The card ID. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
CustomerCard | The deleted customer card. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
DeleteAsync(string, string, RequestOptions, CancellationToken)
Deletes async the card of the customer.
Declaration
public Task<CustomerCard> DeleteAsync(string customerId, string cardId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | The customer ID. |
string | cardId | The card ID. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<CustomerCard> | A task whose the result is the deleted customer card. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
Get(string, string, RequestOptions)
Get the card of the customer.
Declaration
public CustomerCard Get(string customerId, string cardId, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | The customer ID. |
string | cardId | The card ID. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
CustomerCard | The customer card. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
GetAsync(string, string, RequestOptions, CancellationToken)
Get async the card of the customer.
Declaration
public Task<CustomerCard> GetAsync(string customerId, string cardId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | The customer ID. |
string | cardId | The card ID. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<CustomerCard> | A task whose the result is the customer card. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
List(string, RequestOptions)
List the cards of the customer.
Declaration
public ResourcesList<CustomerCard> List(string customerId, RequestOptions requestOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | Customer ID. |
RequestOptions | requestOptions |
Returns
Type | Description |
---|---|
ResourcesList<CustomerCard> | The list of cards. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |
ListAsync(string, RequestOptions, CancellationToken)
List the cards of the customer as an asynchronous operation.
Declaration
public Task<ResourcesList<CustomerCard>> ListAsync(string customerId, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | customerId | Customer ID. |
RequestOptions | requestOptions | |
CancellationToken | cancellationToken | Cancellation token |
Returns
Type | Description |
---|---|
Task<ResourcesList<CustomerCard>> | A task whose the result is the list of cards. |
Remarks
Check the API documentation here.
Exceptions
Type | Condition |
---|---|
MercadoPagoException | If a unexpected exception occurs. |
MercadoPagoApiException | If the API returns a error. |