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

List() public static method

List payments that were made to the merchant who issues the request. Payments can be in any state.
public static List ( APIContext apiContext, int count = null, string startId = "", int startIndex = null, string startTime = "", string endTime = "", string startDate = "", string endDate = "", string payeeEmail = "", string payeeId = "", string sortBy = "", string sortOrder = "" ) : PaymentHistory
apiContext APIContext APIContext used for the API call.
count int The number of items to list in the response.
startId string The ID of the starting resource in the response. When results are paged, you can use the `next_id` value as the `start_id` to continue with the next set of results.
startIndex int The start index of the resources to return. Typically used to jump to a specific position in the resource history based on its cart. Example for starting at the second item in a list of results: `?start_index=2`
startTime string The date and time when the resource was created. Indicates the start of a range of results. Example: `start_time=2013-03-06T11:00:00Z`
endTime string The date and time when the resource was created. Indicates the end of a range of results.
startDate string Resource creation date that indicates the start of results.
endDate string Resource creation date that indicates the end of a range of results.
payeeEmail string Payee identifier (email) to filter the search results in list operations.
payeeId string Payee identifier (merchant id) assigned by PayPal to filter the search results in list operations.
sortBy string Field name that determines sort order of results.
sortOrder string Specifies if order of results is ascending or descending.
return PaymentHistory
        public static PaymentHistory List(APIContext apiContext, int? count = null, string startId = "", int? startIndex = null, string startTime = "", string endTime = "", string startDate = "", string endDate = "", string payeeEmail = "", string payeeId = "", string sortBy = "", string sortOrder = "")
        {
            // Validate the arguments to be used in the request
            ArgumentValidator.ValidateAndSetupAPIContext(apiContext);

            var queryParameters = new QueryParameters();
            queryParameters["count"] = count.ToString();
            queryParameters["start_id"] = startId;
            queryParameters["start_index"] = startIndex.ToString();
            queryParameters["start_time"] = startTime;
            queryParameters["end_time"] = endTime;
            queryParameters["start_date"] = startDate;
            queryParameters["end_date"] = endDate;
            queryParameters["payee_email"] = payeeEmail;
            queryParameters["payee_id"] = payeeId;
            queryParameters["sort_by"] = sortBy;
            queryParameters["sort_order"] = sortOrder;

            // Configure and send the request
            var resourcePath = "v1/payments/payment" + queryParameters.ToUrlFormattedString();
            return PayPalResource.ConfigureAndExecute<PaymentHistory>(apiContext, HttpMethod.GET, resourcePath);
        }