public SubmitPersonalOrderResponse(ExchangeResponse response, SubmitPersonalOrderRequest request) : base(response) { if (response.ErrorMessage != null) { Message = response.ErrorMessage; } else { var json = response.ContentBody; try { var jToken = JToken.Parse(json); //{"message":"Insufficient funds"} var msgToken = jToken["message"]; if (msgToken != null) { Message = "SubmitPersonalOrderResponse: " + msgToken.Value <string>() + ", request: " + request.RequestUrl; } else { SubmittedOrder = new PersonalOrder(jToken); } } catch (Newtonsoft.Json.JsonReaderException e) { Message = "Error w/ SubmitPersonalOrderResponse() " + e.Message + ": " + json; } } }
public async Task <SubmitPersonalOrderResponse> SubmitPersonalOrderAsync(PersonalOrderParams orderParams) { var request = new SubmitPersonalOrderRequest(orderParams); var response = await this.GetResponse(request); return(new SubmitPersonalOrderResponse(response)); }
public SubmitPersonalOrderResponse(ExchangeResponse response, SubmitPersonalOrderRequest request) : base(response) { var json = response.ContentBody; var jToken = JToken.Parse(json); //{"message":"Insufficient funds"} var msgToken = jToken["message"]; if (msgToken != null) { Message = "SubmitPersonalOrderResponse: " + msgToken.Value <string>() + ", request: " + request.RequestUrl; } else { SubmittedOrder = new PersonalOrder(jToken); } }