コード例 #1
0
        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);
        }
コード例 #2
0
 public void Init()
 {
     instance = new V1TransactionsApi();
 }