public static List <Transaction> GetTransactions(string apiKey, DateTime startDate, DateTime endDate) { Configuration.Default.AccessToken = apiKey; var locationClient = new LocationsApi(); var transactionClient = new V1TransactionsApi(); var locations = locationClient.ListLocations(); var payments = new List <V1Payment>(); foreach (var location in locations.Locations) { payments.AddRange(transactionClient.ListPayments( location.Id, null, startDate.ToString("yyyy-MM-ddTHH:mm:ssZ"), endDate.ToString("yyyy-MM-ddTHH:mm:ssZ"))); } var transactions = payments.Select(SquareMapping.MapToTransaction).ToList(); return(transactions); }
public void Init() { instance = new V1TransactionsApi(); }