/// <summary> /// This *hopefully* places an Order to Dominos. /// Not really sure if this works, not really going to pay. /// This requires testing. /// </summary> /// <param name="creditCard">The credit card one is paying with. null if paying in cash.</param> public JObject placeOrder(Payment.CreditCard creditCard) { if (creditCard.cardType == Payment.CreditCard.CreditCardType.MAX) { throw new Exception("Credit Card is not a valid type!"); } if (creditCard == null) { payWith(); } else { payWith(creditCard); } JObject response = send(URLs.placeURL(store.country), false); if (response["Status"].ToString() == "-1") { throw new Exception("Dominos returned -1 due to order being, \"" + errorReason(response["Order"]) + "\" | Response: " + response.ToString()); } return(response); }
/// <summary> /// Checks the validation of an order /// </summary> /// <returns>If the order is valid</returns> public bool validateOrder() { JObject s = send(URLs.placeURL(store.country), false); return(s["Status"].ToString() != "-1"); }