public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain;charset=UTF-8";

            string             TraderNo             = context.Request.QueryString["TraderNo"];
            CRequestPayTradeNo newRequestPayTradeNo = new CRequestPayTradeNo();
            PayData            _Data = PayData.Find(TraderNo, PayType.ALI_PAY);

            if (_Data == null)
            {
                newRequestPayTradeNo.code = 1;
                newRequestPayTradeNo.msg  = "未找到此交易定单:" + TraderNo;
            }
            else if (_Data.Status == 0)
            {
                newRequestPayTradeNo.Amount = _Data.Amount;
                newRequestPayTradeNo.code   = 2;
                newRequestPayTradeNo.msg    = "等待支付宝返回结果";
            }
            else
            {
                //                 DataSet ds = FacadeManage.aideTreasureFacade.DataProvider.GetDbHelper().ExecuteDataset(CommandType.Text,
                //                     "select Score from GameScoreInfo where UserID=" + _Data.UserId);
                //                 if (ds.Tables[0].Rows.Count > 0)
                //                 {
                //                     int src = Convert.ToInt32(ds.Tables[0].Rows[0]["Score"]);
                //                     newRequestPayTradeNo.Amount = src;
                //                 }
                newRequestPayTradeNo.Amount = _Data.Amount;
                newRequestPayTradeNo.code   = 0;
                newRequestPayTradeNo.msg    = "";
            }
            context.Response.Write(LitJson.JsonMapper.ToJson(newRequestPayTradeNo));
        }
Example #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            CRequestPayTradeNo newPayServerInfoCellMgr = new CRequestPayTradeNo();

            newPayServerInfoCellMgr.TradeNo = DateTime.Now.Ticks.ToString();
            context.Response.Write(LitJson.JsonMapper.ToJson(newPayServerInfoCellMgr));
        }
Example #3
0
        private void WriteResult(bool result, string msg, HttpContext context)
        {
            Debug.LogError("Bank Pay Check", msg);

            var data = new CRequestPayTradeNo();

            data.code = result ? 0 : 1;
            data.msg  = msg;
            context.Response.Write(LitJson.JsonMapper.ToJson(data));
        }
Example #4
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     CRequestPayTradeNo newPayServerInfoCellMgr = new CRequestPayTradeNo();
     while (true)
     {
         lock (CreateTradeNo)
         {
             newPayServerInfoCellMgr.TradeNo = DateTime.Now.Ticks.ToString() + Num++.ToString();
             if (CreateTradeNo.ContainsKey(newPayServerInfoCellMgr.TradeNo))
                 continue;
             CreateTradeNo.Add(newPayServerInfoCellMgr.TradeNo, newPayServerInfoCellMgr.TradeNo);
             break;
         }
     }
     context.Response.Write(LitJson.JsonMapper.ToJson(newPayServerInfoCellMgr));
 }