Searching for Credit Cards
Single Credit Card
If you want to look up a single credit card using its token, use the find method.
CreditCard creditCard = gateway.CreditCard.Find("the_token");
To determine if credit_card is a Customer’s default Credit Card:
creditCard.IsDefault();
If the credit card cannot be found, it will throw a NotFoundException.
Transactions
You can find transactions associated to a specific credit card token using the transaction search API.
var searchRequest = new TransactionSearchRequest().
PaymentMethodToken.Is("the_token");
ResourceCollection<Transaction> collection = gateway.Transaction.Search(searchRequest);
Expired Cards
You can find all credit cards stored in the vault that are expired.
ResourceCollection<CreditCard> collection = gateway.CreditCard.Expired();
You can also search for credit cards that expire between a date range.
DateTime beginning = new DateTime(2010, 1, 1);
DateTime end = new DateTime(2010, 12, 31);
ResourceCollection<CreditCard> collection = gateway.CreditCard.ExpiringBetween(beginning, end);