PayPal.Api.CreditCard.List C# (CSharp) Method

List() public static method

Retrieves a list of Credit Card resources.
public static List ( APIContext apiContext, int pageSize = 10, int page = 1, string startTime = "", string endTime = "", string sortOrder = "asc", string sortBy = "create_time", string merchantId = "", string externalCardId = "", string externalCustomerId = "", bool totalRequired = true ) : PayPal.Api.CreditCardList
apiContext APIContext APIContext used for the API call.
pageSize int Number of items to be returned in the current page size, by a GET operation.
page int The page number to be retrieved, for the list of items, by the current GET request.
startTime string Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the start of a range of results.
endTime string Resource creation time as ISO8601 date-time format (ex: 1994-11-05T13:15:30Z) that indicates the end of a range of results.
sortOrder string Sort based on order of results. Options include 'asc' for ascending order or 'desc' for descending order.
sortBy string Sort based on 'create_time' or 'update_time'.
merchantId string Merchant identifier to filter the search results in list operations.
externalCardId string Externally provided card identifier to filter the search results in list operations.
externalCustomerId string Externally provided customer identifier to filter the search results in list operations.
totalRequired bool Identifies if total count is required or not. Defaults to true.
return PayPal.Api.CreditCardList
        public static CreditCardList List(APIContext apiContext, int pageSize = 10, int page = 1, string startTime = "", string endTime = "", string sortOrder = "asc", string sortBy = "create_time", string merchantId = "", string externalCardId = "", string externalCustomerId = "", bool totalRequired = true)
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);

            var queryParameters = new QueryParameters();
            queryParameters["page_size"] = pageSize.ToString();
            queryParameters["page"] = page.ToString();
            queryParameters["start_time"] = startTime;
            queryParameters["end_time"] = endTime;
            queryParameters["sort_order"] = sortOrder;
            queryParameters["sort_by"] = sortBy;
            queryParameters["merchant_id"] = merchantId;
            queryParameters["external_card_id"] = externalCardId;
            queryParameters["external_customer_id"] = externalCustomerId;
            queryParameters["total_required"] = totalRequired.ToString();

            // Configure and send the request
            var resourcePath = "v1/vault/credit-cards" + queryParameters.ToUrlFormattedString();
            return PayPalResource.ConfigureAndExecute<CreditCardList>(apiContext, HttpMethod.GET, resourcePath);
        }