Class CardTokenClient
Client to use Card Token API.
Inherited Members
Namespace: MercadoPago.Client.CardToken
Assembly: MercadoPago.dll
Syntax
public class CardTokenClient : MercadoPagoClient<CardToken>Constructors
| Edit this page View SourceCardTokenClient()
Initializes a new instance of the CardTokenClient class.
Declaration
public CardTokenClient()CardTokenClient(IHttpClient)
Initializes a new instance of the CardTokenClient class.
Declaration
public CardTokenClient(IHttpClient httpClient)Parameters
| Type | Name | Description | 
|---|---|---|
| IHttpClient | httpClient | The http client that will be used in HTTP requests. | 
CardTokenClient(IHttpClient, ISerializer)
Initializes a new instance of the CardTokenClient class.
Declaration
public CardTokenClient(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. | 
CardTokenClient(ISerializer)
Initializes a new instance of the CardTokenClient class.
Declaration
public CardTokenClient(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(CardTokenRequest, RequestOptions)
Creates a card token.
Declaration
public CardToken Create(CardTokenRequest request, RequestOptions requestOptions = null)Parameters
| Type | Name | Description | 
|---|---|---|
| CardTokenRequest | request | The data to create the card token. | 
| RequestOptions | requestOptions | 
Returns
| Type | Description | 
|---|---|
| CardToken | The created card token. | 
Exceptions
| Type | Condition | 
|---|---|
| MercadoPagoException | If a unexpected exception occurs. | 
| MercadoPagoApiException | If the API returns a error. | 
CreateAsync(CardTokenRequest, RequestOptions, CancellationToken)
Creates a card token as an asynchronous operation.
Declaration
public Task<CardToken> CreateAsync(CardTokenRequest request, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| CardTokenRequest | request | The data to create the card token. | 
| RequestOptions | requestOptions | |
| CancellationToken | cancellationToken | Cancellation token | 
Returns
| Type | Description | 
|---|---|
| Task<CardToken> | A task whose the result is the created card token. | 
Exceptions
| Type | Condition | 
|---|---|
| MercadoPagoException | If a unexpected exception occurs. | 
| MercadoPagoApiException | If the API returns a error. | 
Get(string, RequestOptions)
Get the card token data by your ID (token).
Declaration
public CardToken Get(string id, RequestOptions requestOptions = null)Parameters
| Type | Name | Description | 
|---|---|---|
| string | id | The card token ID (token). | 
| RequestOptions | requestOptions | 
Returns
| Type | Description | 
|---|---|
| CardToken | The card token. | 
Exceptions
| Type | Condition | 
|---|---|
| MercadoPagoException | If a unexpected exception occurs. | 
| MercadoPagoApiException | If the API returns a error. | 
GetAsync(string, RequestOptions, CancellationToken)
Get async the card token data by your ID (token).
Declaration
public Task<CardToken> GetAsync(string id, RequestOptions requestOptions = null, CancellationToken cancellationToken = default)Parameters
| Type | Name | Description | 
|---|---|---|
| string | id | The card token ID (token). | 
| RequestOptions | requestOptions | |
| CancellationToken | cancellationToken | Cancellation token | 
Returns
| Type | Description | 
|---|---|
| Task<CardToken> | A task whose the result is the card token. | 
Exceptions
| Type | Condition | 
|---|---|
| MercadoPagoException | If a unexpected exception occurs. | 
| MercadoPagoApiException | If the API returns a error. |