static public async Task <ListTransactionsResponse> GetTransactions(string id) { TransactionsApi api = new TransactionsApi(); ListTransactionsResponse resp = await api.ListTransactionsAsync(id); return(resp); }
public static void Main(string[] args) { // Configure OAuth2 access token for authorization: oauth2 string HMS = "sq0atp-M5ylQzjwtUqHFV_1aZBkWw"; string TEST = "sq0atp-NbIspn1KqTCzVxmJJblliQ"; Configuration.Default.AccessToken = HMS; // PortCustomersAsync().Wait(); //WebRequest.DefaultWebProxy = new WebProxy("127.0.0.1", 8888); //FixLocations().Wait(); List <ShopifySharp.Product> products = Shopify.GetProductsAsync().Result; //SetInventory(products).Wait(); //FixBarCodes(products).Wait(); ListLocationsResponse locations = GetLocations().Result; // DeleteProducts().Wait(); // PortItemsAsync(locations.Locations[0].Id).Wait(); // PortItemsAsync("me").Wait(); ListTransactionsResponse transactions = GetTransactions(locations.Locations[0].Id).Result; Customer customer = GetCustomer("Raboud", "Robert").Result; Customer customer2 = GetCustomer("Raboud", "Carrie").Result; GetProductsAsync().Wait(); //var customerTransactions = transactions.Transactions.Where(t => t.Tenders.Any(te => te.CustomerId == customer.Id)).ToList(); //foreach (var transaction in customerTransactions) //{ // foreach (var tender in transaction.Tenders) // { // if (tender.CustomerId == customer.Id) // { // tender.CustomerId = customer2.Id; // } // } //} }
/// <summary> /// Unmarshaller the response from the service to the response class. /// </summary> /// <param name="context"></param> /// <returns></returns> public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context) { ListTransactionsResponse response = new ListTransactionsResponse(); context.Read(); int targetDepth = context.CurrentDepth; while (context.ReadAtDepth(targetDepth)) { if (context.TestExpression("NextToken", targetDepth)) { var unmarshaller = StringUnmarshaller.Instance; response.NextToken = unmarshaller.Unmarshall(context); continue; } if (context.TestExpression("Transactions", targetDepth)) { var unmarshaller = new ListUnmarshaller<TransactionDescription, TransactionDescriptionUnmarshaller>(TransactionDescriptionUnmarshaller.Instance); response.Transactions = unmarshaller.Unmarshall(context); continue; } } return response; }