コード例 #1
0
 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;
         }
     }
 }
コード例 #2
0
        public async Task <SubmitPersonalOrderResponse> SubmitPersonalOrderAsync(PersonalOrderParams orderParams)
        {
            var request  = new SubmitPersonalOrderRequest(orderParams);
            var response = await this.GetResponse(request);

            return(new SubmitPersonalOrderResponse(response));
        }
コード例 #3
0
        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);
            }
        }