Package com.mercadopago.client.cardtoken
Class CardTokenClient
- java.lang.Object
-
- com.mercadopago.client.MercadoPagoClient
-
- com.mercadopago.client.cardtoken.CardTokenClient
-
public class CardTokenClient extends MercadoPagoClient
Client for retrieving the token for a card.
-
-
Field Summary
-
Fields inherited from class com.mercadopago.client.MercadoPagoClient
defaultHeaders, httpClient
-
-
Constructor Summary
Constructors Constructor Description CardTokenClient()
Default constructor.CardTokenClient(MPHttpClient httpClient)
CardTokenClient constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CardToken
create(CardTokenRequest request)
Create token associated with a card.CardToken
create(CardTokenRequest request, MPRequestOptions requestOptions)
Create token associated with a card.CardToken
get(String id)
Get card token.CardToken
get(String id, MPRequestOptions requestOptions)
Get card token.
-
-
-
Constructor Detail
-
CardTokenClient
public CardTokenClient()
Default constructor. Uses http client provided by MercadoPagoConfig.
-
CardTokenClient
public CardTokenClient(MPHttpClient httpClient)
CardTokenClient constructor.- Parameters:
httpClient
- http client
-
-
Method Detail
-
get
public CardToken get(String id) throws MPException, MPApiException
Get card token.- Parameters:
id
- card id- Returns:
- card token information
- Throws:
MPException
MPApiException
-
get
public CardToken get(String id, MPRequestOptions requestOptions) throws MPException, MPApiException
Get card token.- Parameters:
id
- card idrequestOptions
- metadata to customize the request- Returns:
- card token information
- Throws:
MPException
MPApiException
-
create
public CardToken create(CardTokenRequest request) throws MPException, MPApiException
Create token associated with a card.- Parameters:
request
- attributes used to perform the request- Returns:
- card token information
- Throws:
MPException
- an error if the request failsMPApiException
-
create
public CardToken create(CardTokenRequest request, MPRequestOptions requestOptions) throws MPException, MPApiException
Create token associated with a card.- Parameters:
request
- attributes used to perform the requestrequestOptions
- metadata to customize the request- Returns:
- card token information
- Throws:
MPException
- an error if the request failsMPApiException
-
-