Package com.mercadopago.client.customer
Class CustomerCardClient
- java.lang.Object
-
- com.mercadopago.client.MercadoPagoClient
-
- com.mercadopago.client.customer.CustomerCardClient
-
public class CustomerCardClient extends MercadoPagoClient
Client responsible for performing customer card actions.
-
-
Field Summary
-
Fields inherited from class com.mercadopago.client.MercadoPagoClient
defaultHeaders, httpClient
-
-
Constructor Summary
Constructors Constructor Description CustomerCardClient()
Default constructor.CustomerCardClient(MPHttpClient httpClient)
Constructor used for providing a custom http client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomerCard
create(String customerId, CustomerCardCreateRequest request)
Add card for customer.CustomerCard
create(String customerId, CustomerCardCreateRequest request, MPRequestOptions requestOptions)
Add card for customer.CustomerCard
delete(String customerId, String cardId)
Remove card for customer.CustomerCard
delete(String customerId, String cardId, MPRequestOptions requestOptions)
Remove card for customer.CustomerCard
get(String customerId, String cardId)
Get card of customer.CustomerCard
get(String customerId, String cardId, MPRequestOptions requestOptions)
Get card of customer.MPResourceList<CustomerCard>
listAll(String customerId)
List all cards of customer.MPResourceList<CustomerCard>
listAll(String customerId, MPRequestOptions requestOptions)
List all cards of customer.
-
-
-
Constructor Detail
-
CustomerCardClient
public CustomerCardClient()
Default constructor. Uses the default http client used by the SDK
-
CustomerCardClient
public CustomerCardClient(MPHttpClient httpClient)
Constructor used for providing a custom http client.- Parameters:
httpClient
- http client used for performing requests
-
-
Method Detail
-
get
public CustomerCard get(String customerId, String cardId) throws MPException, MPApiException
Get card of customer.- Parameters:
customerId
- id of the customer to which the card belongscardId
- id of the card being requested- Returns:
- the requested customer card
- Throws:
MPException
- any error retrieving the customer cardMPApiException
-
get
public CustomerCard get(String customerId, String cardId, MPRequestOptions requestOptions) throws MPException, MPApiException
Get card of customer.- Parameters:
customerId
- id of the customercardId
- id of the card being retrievedrequestOptions
- metadata to customize the request- Returns:
- customer card retrieved
- Throws:
MPException
- any error retrieving the customer cardMPApiException
-
create
public CustomerCard create(String customerId, CustomerCardCreateRequest request) throws MPException, MPApiException
Add card for customer.- Parameters:
customerId
- id of the customerrequest
- attributes used to perform the request- Returns:
- the customer card just added
- Throws:
MPException
- any error creating the customer cardMPApiException
-
create
public CustomerCard create(String customerId, CustomerCardCreateRequest request, MPRequestOptions requestOptions) throws MPException, MPApiException
Add card for customer.- Parameters:
customerId
- id of the customerrequest
- attributes used to perform the requestrequestOptions
- metadata to customize the request- Returns:
- the customer card just added
- Throws:
MPException
- any error creating the customer cardMPApiException
-
delete
public CustomerCard delete(String customerId, String cardId) throws MPException, MPApiException
Remove card for customer.- Parameters:
customerId
- id of the customercardId
- id of the card being removed- Returns:
- the customer card just removed
- Throws:
MPException
- any error removing the customer cardMPApiException
-
delete
public CustomerCard delete(String customerId, String cardId, MPRequestOptions requestOptions) throws MPException, MPApiException
Remove card for customer.- Parameters:
customerId
- id of the customercardId
- id of the card being retrievedrequestOptions
- metadata to customize the request- Returns:
- the customer card just removed
- Throws:
MPException
- any error removing the customer cardMPApiException
-
listAll
public MPResourceList<CustomerCard> listAll(String customerId) throws MPException, MPApiException
List all cards of customer.- Parameters:
customerId
- id of the customer- Returns:
- list of customer cards retrieved
- Throws:
MPException
- any error listing customer cardsMPApiException
-
listAll
public MPResourceList<CustomerCard> listAll(String customerId, MPRequestOptions requestOptions) throws MPException, MPApiException
List all cards of customer.- Parameters:
customerId
- id of the customerrequestOptions
- metadata to customize the request- Returns:
- list of customer cards retrieved
- Throws:
MPException
- any error listing customer cardsMPApiException
-
-