public static List <PCOFund> GetFunds(bool importing, DateTime?updatedAfter, string apiEndPoint) { // Create variables to store the results var dataItems = new List <PCOData>(); var includedItems = new List <PCOData>(); // Set the endpoint if not passed from parameter apiEndPoint = apiEndPoint ?? "https://api.planningcenteronline.com/giving/v2/funds"; // Query Planning Center for people if (PCOGetItems(apiEndPoint, dataItems, includedItems, updatedAfter, !importing, "", "")) { // Create variable to store the people var funds = new List <PCOFund>(); // Loop through each item in the result of api call foreach (var item in dataItems) { // Create the person record var fund = new PCOFund(item); if (fund != null) { // Add to list of results funds.Add(fund); } } // return the list of people return(funds); } // An error occurred trying to query people so return null return(null); }
public static FinancialAccount Translate( PCOFund inputAccount ) { var financialAccount = new FinancialAccount(); financialAccount.Id = inputAccount.id; financialAccount.Name = inputAccount.name; financialAccount.IsTaxDeductible = true; return financialAccount; }