question

Dhanaraj avatar image
Dhanaraj asked ·

How to get Customer card details

How to get card details for particular customer.
Customers
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Raymond Lee avatar image
Raymond Lee answered ·
Hi @Dhanaraj,

If you are using REST API, you can use the following endpoint with a field expansion on cards:

GET /v3/merchants/{
                {mId}}/customers/{
                {cId}}/?expand=cards

Then you can iterate through the list of customer's cards, and get the card details for a particular card.

If you are using Android SDK, you can use the CustomerConnector to get the specific customer, then get the list of cards. You can then get whatever detail you want from a particular card.

Here is a sample code of getting the last4 of each of a customer's list of cards.

CustomerConnector customerConnector = new CustomerConnector(getApplicationContext(), mAccount, null);

Customer customer = customerConnector.getCustomer("FPSGSWGPY888J");

List<Card> customerCards = customer.getCards();

for (Card card : customerCards) {
    Log.d("LAST4", card.getLast4());
}

Hope that helps,

Raymond
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community