Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// YOU BETTER THANK ME I JUST SAVED YOU A LOT OF TIME THIS TOOK HOURS
public class Address
{
[JsonProperty("Street")]
public string Street = "";
[JsonProperty("City")]
public string City = "";
[JsonProperty("Region")]
public string Region = "";
[JsonProperty("PostalCode")]
public string PostalCode = "";
[JsonProperty("Type")]
public string Type = "House";
}
public class Option
{
[JsonProperty("1/1", NullValueHandling = NullValueHandling.Ignore)]
public string OnProduct = null;
[JsonProperty("1/2", NullValueHandling = NullValueHandling.Ignore)]
public string OnProductHalf = null;
[JsonProperty("1/4", NullValueHandling = NullValueHandling.Ignore)]
public string OnProductQuarter = null;
public void Remove()
{
this.OnProduct = null;
this.OnProductHalf = null;
this.OnProductQuarter = null;
}
public void Add(string w = "1/1")
{
switch (w)
{
case "1/1":
this.OnProduct = "1";
break;
case "1/2":
this.OnProductHalf = "1";
break;
case "1/4":
this.OnProductQuarter = "1";
break;
}
}
}
public class Payment
{
[JsonProperty("Type")]
public string Type = "CreditCard";
[JsonProperty("Amount")]
public double Amount = 0;
[JsonProperty("Number")]
public string Number = "";
[JsonProperty("CardType")]
public string CardType = "";
[JsonProperty("Expiration")]
public string Expiration = "";
[JsonProperty("SecurityCode")]
public string SecurityCode = "";
[JsonProperty("PostalCode")]
public string PostalCode = "";
}
public class Options
{
public class Pizza{
[JsonProperty("X")]
public Option RobustInspiredTomatoSauce = new Option();
[JsonProperty("Xm")]
public Option HeartyMarinaraSauce = new Option();
[JsonProperty("Bq")]
public Option BBQSauce = new Option();
[JsonProperty("Xw")]
public Option WhiteSauce = new Option();
[JsonProperty("P")]
public Option Pepperoni = new Option();
[JsonProperty("S")]
public Option ItalianSausage = new Option();
[JsonProperty("Sb")]
public Option SlicedItalianSausage = new Option();
[JsonProperty("B")]
public Option Beef = new Option();
[JsonProperty("Pm")]
public Option PhillySteak = new Option();
[JsonProperty("H")]
public Option Ham = new Option();
[JsonProperty("K")]
public Option Bacon = new Option();
[JsonProperty("Sa")]
public Option Salami = new Option();
[JsonProperty("Du")]
public Option PremiumChicken = new Option();
[JsonProperty("A")]
public Option Anchovies = new Option();
[JsonProperty("E")]
public Option CheddarCheese = new Option();
[JsonProperty("Fe")]
public Option FetaCheese = new Option();
[JsonProperty("Cs")]
public Option ShreddedParmesanAsiago = new Option();
[JsonProperty("Cp")]
public Option ShreddedProvoloneCheese = new Option();
[JsonProperty("Z")]
public Option BananaPeppers = new Option();
[JsonProperty("R")]
public Option BlackOlives = new Option();
[JsonProperty("F")]
public Option Garlic = new Option();
[JsonProperty("G")]
public Option GreenPeppers = new Option();
[JsonProperty("J")]
public Option JalapenoPeppers = new Option();
[JsonProperty("M")]
public Option Mushrooms = new Option();
[JsonProperty("N")]
public Option Pineapple = new Option();
[JsonProperty("O")]
public Option Onions = new Option();
[JsonProperty("Rr")]
public Option RoastedRedPeppers = new Option();
[JsonProperty("Si")]
public Option Spinach = new Option();
[JsonProperty("Td")]
public Option DicedTomatoes = new Option();
[JsonProperty("Ht")]
public Option HotSauce = new Option();
}
}
public class Coupon
{
public Coupon(string code)
{
this.Code = code;
}
[JsonProperty("Code")]
public string Code = "";
[JsonProperty("ID")]
public int ID = 1;
[JsonProperty("Qty")]
public int Qty = 1;
}
public class Pizza
{
public Pizza(string size)
{
this.Code = size + "SCREEN";
}
[JsonProperty("Code")]
public string Code = "14SCREEN";
[JsonProperty("Qty")]
public int Qty = 1;
[JsonProperty("ID")]
public int ID = 1;
[JsonProperty("isNew")]
public bool IsNew = true;
[JsonProperty("Options")]
public Options.Pizza Options = new Options.Pizza();
[JsonProperty("descriptions")]
public JArray Descriptions = new JArray();
}
public class Order
{
[JsonProperty("Address")]
public Address Address = new Address();
[JsonProperty("Coupons")]
public List<Coupon> Coupons = new List<Coupon>();
[JsonProperty("CustomerID")]
public string CustomerID = "";
[JsonProperty("Email")]
public string Email = "";
[JsonProperty("Extension")]
public string Extension = "";
[JsonProperty("FirstName")]
public string FirstName = "";
[JsonProperty("LastName")]
public string LastName = "";
[JsonProperty("LanguageCode")]
public string LanguageCode = "en";
[JsonProperty("OrderChannel")]
public string OrderChannel = "OLO";
[JsonProperty("OrderID")]
public string OrderID = "";
[JsonProperty("Amounts")]
public JObject Amounts = new JObject();
[JsonProperty("OrderMethod")]
public string OrderMethod = "Web";
[JsonProperty("OrderTaker")]
public string OrderTaker = null;
[JsonProperty("Partners")]
public JObject Partners = new JObject();
[JsonProperty("Payments")]
public List<Payment> Payments = new List<Payment>();
[JsonProperty("Phone")]
public string Phone = "";
[JsonProperty("Products")]
public List<Pizza> Products = new List<Pizza>();
[JsonProperty("ServiceMethod")]
public string ServiceMethod = "Delivery";
[JsonProperty("SourceOrganizationURI")]
public string SourceOrganizationURI = "order.dominos.com";
[JsonProperty("StoreID")]
public string StoreID = "";
[JsonProperty("Version")]
public string Version = "1.0";
[JsonProperty("Tags")]
public JObject Tags = new JObject();
[JsonProperty("Status")]
public string Status = "";
public void AddCoupon(string code)
{
this.Coupons.Add(new Coupon(code));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.