Example #1
0
        /// <summary>
        /// 门票售卖
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static TVMResult <List <SaleTicket_Result> > SaleTicket(QuickPayment_Object obj)
        {
            var data   = JsonSerializeHelper.ToJson(obj);
            var result = HttpHelper.Post(urlTvm + "SaleTicket", data, 60);

            return(JsonSerializeHelper.ToObject <TVMResult <List <SaleTicket_Result> > >(result));
        }
Example #2
0
        /// <summary>
        /// 凭证码、身份证核销
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static TVMResult <bool> VerifyTicket(VerifyTicket_Object obj)
        {
            var data   = JsonSerializeHelper.ToJson(obj);
            var result = HttpHelper.Post(urlTvm + "VerifyTicket", data, 180);

            return(JsonSerializeHelper.ToObject <TVMResult <bool> >(result));
        }
Example #3
0
        /// <summary>
        /// 获取产品信息
        /// </summary>
        /// <param name="device"></param>
        /// <returns></returns>
        public static TVMResult <GUITikcetConfig> DeviceIni(TVMDevice device)
        {
            var data   = JsonSerializeHelper.ToJson(device);
            var result = HttpHelper.Post(urlTvm + "DeviceIni", data, 60);

            return(JsonSerializeHelper.ToObject <TVMResult <GUITikcetConfig> >(result));
        }
Example #4
0
        /// <summary>
        /// 查询支付
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static TVMResult <TVMPayInfo> QueryPay(QuickPayment_Object obj)
        {
            var data   = JsonSerializeHelper.ToJson(obj);
            var result = HttpHelper.Post(urlTvm + "QueryPay", data, 60);

            return(JsonSerializeHelper.ToObject <TVMResult <TVMPayInfo> >(result));
        }
Example #5
0
        public static Result <TicketResult> Ticket_CheckTicket(CheckTicket_Object checkTicketObject)
        {
            var data   = JsonSerializeHelper.ToJson(checkTicketObject);
            var result = HttpHelper.Post(url + "Ticket_CheckTicket", data, 60);

            return(JsonSerializeHelper.ToObject <Result <TicketResult> >(result));
        }
Example #6
0
        public static Result <TicketResult> Ticket_SubmitWalkPast(SubmitWalkPast_Object submitWalkPastObject)
        {
            var data   = JsonSerializeHelper.ToJson(submitWalkPastObject);
            var result = HttpHelper.Post(url + "Ticket_SubmitWalkPast", data, 60);

            return(JsonSerializeHelper.ToObject <Result <TicketResult> >(result));
        }
Example #7
0
        /// <summary>
        /// 凭证码、身份证取票
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public static TVMResult <TVMTicketInfo[]> GetTicketOrder(TicketOrder_Object obj)
        {
            var data   = JsonSerializeHelper.ToJson(obj);
            var result = HttpHelper.Post(urlTvm + "GetTicketOrder", data, 180);

            return(JsonSerializeHelper.ToObject <TVMResult <TVMTicketInfo[]> >(result));
        }
Example #8
0
        /// <summary>
        /// 消费通知接口
        /// </summary>
        /// <param name="noticeOrderConsumedRequest"></param>
        /// <returns></returns>
        public static bool Run(ConsumeNoticeRequest consumeNoticeRequest)
        {
            string requestBody = JsonSerializeHelper.ToJson(consumeNoticeRequest);

            requestBody = DesHelper.Encrypt(requestBody, TongChengConfig.UserKey);
            var         sign    = Helper.MakeSign("ConsumeNotice", requestBody);
            RequestData request = new RequestData
            {
                RequestHead = new RequestHead
                {
                    user_id   = TongChengConfig.UserId,
                    Method    = "ConsumeNotice",
                    Timestamp = Helper.GenerateTimeStamp(),
                    Version   = TongChengConfig.Version,
                    Sign      = sign
                },
                RequestBody = requestBody
            };
            string body = JsonSerializeHelper.ToJson(request);

            body = Helper.Base64Encode(body);
            var contnt = HttpService.Post(body, TongChengConfig.Website);

            if (!string.IsNullOrEmpty(contnt))
            {
                contnt = Helper.Base64Decode(contnt);
                var response = JsonSerializeHelper.ToObject <ResponseData>(contnt);
                if (response != null && response.responseHead.res_code == ResultCode.Success)
                {
                    return(true);
                }
            }
            return(false);
        }
Example #9
0
        /// <summary>
        /// 错误返回
        /// </summary>
        /// <param name="code"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static string ErrorResult(string code, string msg)
        {
            var responseData = new ResponseData
            {
                responseHead = new ResponseHead
                {
                    res_code  = code,
                    res_msg   = msg,
                    timestamp = Helper.GenerateTimeStamp()
                }
            };
            var json = JsonSerializeHelper.ToJson(responseData);

            return(Helper.Base64Encode(json));
        }
Example #10
0
        /// <summary>
        /// 成功返回
        /// </summary>
        /// <param name="code"></param>
        /// <param name="msg"></param>
        /// <returns></returns>
        public static string SuccessResult <T>(T responseBody)
        {
            var body = JsonSerializeHelper.ToJson(responseBody);

            body = DesHelper.Encrypt(body, TongChengConfig.UserKey);
            var responseData = new ResponseData
            {
                responseHead = new ResponseHead
                {
                    res_code  = ResultCode.Success,
                    res_msg   = "成功",
                    timestamp = Helper.GenerateTimeStamp()
                },
                responseBody = body
            };
            var json = JsonSerializeHelper.ToJson(responseData);

            return(Helper.Base64Encode(json));
        }
Example #11
0
        /**
         * @Dictionary格式化成Json
         * @return json串数据
         */
        public string ToJson()
        {
            string jsonStr = JsonSerializeHelper.ToJson(m_values);

            return(jsonStr);
        }