public async void AddOrder(object sender, EventArgs e) { TransactionProcessor processor = new TransactionProcessor(); var order = processor.GetOrder(OrderId); //await Navigation.PushAsync(new ) }
private static void E2E() { string sellerPhoneNumber = "07434"; string buyerPhoneNumber = "34075"; string donatorPhoneNumber = "1234"; ApiServer apiServer = new ApiServer("http://africatransferapi.azurewebsites.net/api/"); apiServer.AddPhoneNUmber(sellerPhoneNumber); apiServer.AddPhoneNUmber(buyerPhoneNumber); apiServer.AddPhoneNUmber(donatorPhoneNumber); var x = apiServer.GetAuthModels(); TransactionProcessor processor = new TransactionProcessor(apiServer); processor.AddBankTransfer(44, donatorPhoneNumber); processor.AddMobileTransfer(23, donatorPhoneNumber, buyerPhoneNumber); var product = processor.AddProduct(new Product { Name = "Capriciosa", Price = 22 }); var orderId = processor.AddOrder(new List <OrderLine>() { new OrderLine { ProductID = product.ID, Quantity = 2 } }, sellerPhoneNumber); var order = processor.GetOrder(orderId); var orderTotal = order.OrderLines.Sum(o => o.ProductPrice); processor.ConfirmOrder(order, buyerPhoneNumber); }
public BuyCartPage(int orderID) { InitializeComponent(); ApiServer server = new ApiServer(); var tp = new TransactionProcessor(server); CurrentOrder = tp.GetOrder(orderID); Items = new ObservableCollection <OrderLine>(CurrentOrder.OrderLines); MyListView.ItemsSource = Items; }