private bool UsePaymentMethod(PaymentMethod Method) { string Url = $"https://order.pagliacci.com/Order/OrderEdit/ccadd/file/{Method.ID}"; string json = ""; json = GetUrl(Url); LastOrderJson LastOrderResponse = JsonConvert.DeserializeObject <LastOrderJson>(json); /* TODO * cardAmount = parseFloat(result.NewPrice); * cardType = result.ItemTitle; * lastFour = result.ItemDetail; */ if (Convert.ToInt32(LastOrderResponse.Status) != 0) { Console.WriteLine("Trying to set the payment method failed with status {0}: {1}", LastOrderResponse.Status, LastOrderResponse.Message); return(false); } return(true); }
public Order RepeatLastOrder() { string Url = $"https://order.pagliacci.com/Order/OrderEdit/clone/{LastOrderID}"; string json = ""; json = GetUrl(Url); LastOrderJson LastOrderResponse = JsonConvert.DeserializeObject <LastOrderJson>(json); if (Convert.ToInt32(LastOrderResponse.Status) != 0) { Console.WriteLine("Trying to repeat the last order failed with status {0}: {1}", LastOrderResponse.Status, LastOrderResponse.Message); return(null); } string html = GetUrl("https://order.pagliacci.com/Order/StepOrder"); // TODO -- We might not need to actually fetch this? Order o = new Order(this, Addresses.Find(a => a.IsDefault)); LoadPaymentMethods(); return(o); }