Esempio n. 1
0
        /// <summary>
        /// Add the specified model.
        /// </summary>
        /// <param name="model">Model.</param>
        public bool Add(OrderInfo model)
        {
            model.CreateDate = MathUtils.Now;
            var command = ConfigManger.Provider.CreateCommandStruct("OrderInfo", CommandMode.Insert);
            command.AddParameter("OrderNO", model.OrderNO);
            command.AddParameter("MerchandiseName", model.MerchandiseName);
            command.AddParameter("PayType", model.PayType);
            command.AddParameter("Amount", model.Amount);
            command.AddParameter("Currency", model.Currency);
            command.AddParameter("Expand", model.Expand);
            command.AddParameter("SerialNumber", model.SerialNumber);
            command.AddParameter("PassportID", model.PassportID);
            command.AddParameter("ServerID", model.ServerID);
            command.AddParameter("GameID", model.GameID);
            command.AddParameter("gameName", model.GameName);
            command.AddParameter("ServerName", model.ServerName);
            command.AddParameter("PayStatus", model.PayStatus);
            command.AddParameter("Signature", model.Signature);
            command.AddParameter("Remarks", model.Remarks);
            command.AddParameter("GameCoins", model.GameCoins);
            command.AddParameter("SendState", model.SendState);
            command.AddParameter("RetailID", model.RetailID);
            command.AddParameter("DeviceID", model.DeviceID == null ? string.Empty : model.DeviceID);
            if (model.SendDate > DateTime.MinValue)
            {
                command.AddParameter("SendDate", model.SendDate);
            }
            command.AddParameter("CreateDate", model.CreateDate);
            command.Parser();

            return ConfigManger.Provider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters) > 0;
        }
Esempio n. 2
0
        public override bool TakeAction()
        {
            OrderInfo orderInfo = new OrderInfo();
            orderInfo.OrderNO = _orderNo;
            orderInfo.MerchandiseName = _productID;
            orderInfo.Currency = _currency;
            orderInfo.Amount = _amount;
            orderInfo.PassportID = _passportID;
            orderInfo.RetailID = _retailID;
            orderInfo.PayStatus = 1;
            orderInfo.GameID = _gameID;
            orderInfo.ServerID = _serverID;
            orderInfo.GameName = _gameName;
            orderInfo.ServerName = _serverName;
            orderInfo.GameCoins = (_amount * 10).ToInt();
            orderInfo.SendState = 1;
            orderInfo.PayType = _payType;
            orderInfo.Signature = "000000";
            orderInfo.DeviceID = _deviceID;

            if (PayManager.AddOrder(orderInfo))
            {
                DoSuccess(orderInfo);
                _payStatus = orderInfo.PayStatus;
                TraceLog.ReleaseWriteFatal(string.Format("PayNormal Order:{0},pid:{1} successfully!", _orderNo, _passportID));
                return true;
            }
            ErrorCode = LanguageHelper.GetLang().ErrorCode;
            ErrorInfo = LanguageHelper.GetLang().AppStorePayError;
            TraceLog.ReleaseWriteFatal(string.Format("PayNormal Order:{0},pid:{1} faild!", _orderNo, _passportID));
            return false;
        }
Esempio n. 3
0
        /// <summary>
        /// Get91s the pay info.
        /// </summary>
        /// <param name="gameId">Game.</param>
        /// <param name="serverId">Server.</param>
        /// <param name="passportId">Account.</param>
        /// <param name="serverName">Service name.</param>
        /// <param name="orderNo">Order no.</param>
        /// <param name="retailId">Retail Id.</param>
        /// <param name="userId"></param>
        public static void Get91PayInfo(int gameId, int serverId, string passportId, string serverName, string orderNo, string retailId, string userId = "") {
            //增加游戏名称避免出现游戏名称为空的现象 panx 2012-11-26
            string gameName = string.Empty;
            ServerInfo serverinfo = GetServerData(gameId, serverId);
            if (serverinfo != null) {
                gameName = serverinfo.GameName;
            }

            OrderInfo orderInfo = new OrderInfo();
            orderInfo.OrderNo = orderNo;
            orderInfo.MerchandiseName = string.Empty;
            orderInfo.Currency = "CNY";
            orderInfo.Amount = 0;
            orderInfo.PassportId = passportId;
            orderInfo.Expand = userId;
            orderInfo.RetailId = retailId;
            orderInfo.PayStatus = 1;
            orderInfo.GameId = gameId;
            orderInfo.ServerId = serverId;
            orderInfo.GameName = gameName;
            orderInfo.ServerName = serverName;
            orderInfo.GameCoins = 0;
            orderInfo.SendState = 1;
            orderInfo.PayType = orderInfo.RetailId;
            orderInfo.Signature = "123456";
            OrderFormBLL obll = new OrderFormBLL();
            obll.Add91Pay(orderInfo, false);
        }
Esempio n. 4
0
        /// <summary>
        /// Add the specified model.
        /// </summary>
        /// <param name="model">Model.</param>
        public bool Add(OrderInfo model)
        {
            model.CreateDate = DateTime.Now;
            CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Insert);
            command.AddParameter("OrderNO", SqlDbType.VarChar, model.OrderNO);
            command.AddParameter("MerchandiseName", SqlDbType.VarChar, model.MerchandiseName);
            command.AddParameter("PayType", SqlDbType.VarChar, model.PayType);
            command.AddParameter("Amount", SqlDbType.Decimal, model.Amount);
            command.AddParameter("Currency", SqlDbType.VarChar, model.Currency);
            command.AddParameter("Expand", SqlDbType.VarChar, model.Expand);
            command.AddParameter("SerialNumber", SqlDbType.VarChar, model.SerialNumber);
            command.AddParameter("PassportID", SqlDbType.VarChar, model.PassportID);
            command.AddParameter("ServerID", SqlDbType.Int, model.ServerID);
            command.AddParameter("GameID", SqlDbType.Int, model.GameID);
            command.AddParameter("gameName", SqlDbType.VarChar, model.GameName);
            command.AddParameter("ServerName", SqlDbType.VarChar, model.ServerName);
            command.AddParameter("PayStatus", SqlDbType.Int, model.PayStatus);
            command.AddParameter("Signature", SqlDbType.VarChar, model.Signature);
            command.AddParameter("Remarks", SqlDbType.Text, model.Remarks);
            command.AddParameter("GameCoins", SqlDbType.Int, model.GameCoins);
            command.AddParameter("SendState", SqlDbType.Int, model.SendState);
            command.AddParameter("RetailID", SqlDbType.VarChar, model.RetailID);//添加渠道商ID 孙德尧 2012/4/1 9:24
            command.AddParameter("DeviceID", SqlDbType.VarChar, model.DeviceID == null ? string.Empty : model.DeviceID);
            if (model.SendDate > DateTime.MinValue)
            {
                command.AddParameter("SendDate", SqlDbType.DateTime, model.SendDate);
            }
            command.AddParameter("CreateDate", SqlDbType.DateTime, model.CreateDate);
            command.Parser();

            int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters);
            if (rows > 0)
                return true;
            return false;
        }
Esempio n. 5
0
        /// <summary>
        /// Get91s the pay info.
        /// </summary>
        /// <param name="game">Game.</param>
        /// <param name="Server">Server.</param>
        /// <param name="Account">Account.</param>
        /// <param name="ServiceName">Service name.</param>
        /// <param name="orderNo">Order no.</param>
        /// <param name="RetailID">Retail I.</param>
        public static void get91PayInfo(int game, int Server, string Account, string ServiceName, string orderNo, string RetailID)
        {
            //增加游戏名称避免出现游戏名称为空的现象 panx 2012-11-26
            string GameName = string.Empty;
            ServerInfo serverinfo = GetServerData(game, Server);
            if (serverinfo != null)
            {
                GameName = serverinfo.GameName;
            }

            OrderInfo orderInfo = new OrderInfo();
            orderInfo.OrderNO = orderNo;
            orderInfo.MerchandiseName = string.Empty;
            orderInfo.Currency = "CNY";
            orderInfo.Amount = 0;
            orderInfo.PassportID = Account;
            orderInfo.RetailID = RetailID;
            orderInfo.PayStatus = 1;
            orderInfo.GameID = game;
            orderInfo.ServerID = Server;
            orderInfo.GameName = GameName;
            orderInfo.ServerName = ServiceName;
            orderInfo.GameCoins = 0;
            orderInfo.SendState = 1;
            orderInfo.PayType = orderInfo.RetailID;
            orderInfo.Signature = "123456";
            OrderFormBLL obll = new OrderFormBLL();
            obll.Add91Pay(orderInfo, false);
        }
Esempio n. 6
0
 protected override bool DoNotify(int userId, OrderInfo orderInfo)
 {
     GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(userId.ToString());
     if (userInfo == null) return false;
     userInfo.PayGold = MathUtils.Addition(userInfo.PayGold, orderInfo.GameCoins);
     AchieveTask.SaveUserTask(userId.ToString(), TaskClass.ChongZhi, orderInfo.GameCoins);
     return true;
 }
Esempio n. 7
0
 public bool Add91Pay(OrderInfo order, bool callback)
 {
     if (!IsExists(order.OrderNO))
     {
         return Add(order);
     }
     else
     {
         return UpdateBy91(order, callback);
     }
 }
Esempio n. 8
0
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(OrderInfo model) {
            var command = ConfigManger.Provider.CreateCommandStruct("OrderInfo", CommandMode.Modify);
            command.AddParameter("SerialNumber", model.SerialNumber);
            command.AddParameter("PayStatus", model.PayStatus);
            command.AddParameter("@Signature", model.Signature);
            command.Filter = ConfigManger.Provider.CreateCommandFilter();
            command.Filter.Condition = command.Filter.FormatExpression("OrderNo");
            command.Filter.AddParam("OrderNo", model.OrderNo);
            command.Parser();

            return ConfigManger.Provider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters) > 0;
        }
Esempio n. 9
0
 public static bool AddOrder(OrderInfo orderInfo)
 {
     try
     {
         OrderFormBLL obll = new OrderFormBLL();
         obll.Add91Pay(orderInfo, false);
         return true;
     }
     catch (Exception ex)
     {
         TraceLog.ReleaseWriteFatal(ex.ToString());
         return false;
     }
 }
Esempio n. 10
0
 /// <summary>
 /// 更新订单支付成功状态
 /// </summary>
 /// <param name="orderNo"></param>
 /// <param name="orderInfo"></param>
 /// <returns></returns>
 public static bool PaySuccess(string orderNo, OrderInfo orderInfo)
 {
     OrderFormBLL obll = new OrderFormBLL();
     return obll.PaySuccess(orderNo, orderInfo);
 }
Esempio n. 11
0
        /// <summary>
		/// appstroe充值
        /// </summary>
        /// <param name="game">Game.</param>
        /// <param name="Server">Server.</param>
        /// <param name="Account">Account.</param>
        /// <param name="Silver">Silver.</param>
        /// <param name="Amount">Amount.</param>
        /// <param name="orderNo">Order no.</param>
        /// <param name="RetailID">Retail I.</param>
        /// <param name="MemberMac">Member mac.</param>
        public static void AppStorePay(int game, int Server, string Account, int Silver, int Amount, string orderNo, string RetailID, string MemberMac)
        {
            try
            {
                string GameName = string.Empty;
                string ServerName = string.Empty;
                ServerInfo serverinfo = GetServerData(game, Server);
                if (serverinfo != null)
                {
                    GameName = serverinfo.GameName;
                    ServerName = serverinfo.Name;
                }

                OrderInfo orderInfo = new OrderInfo();
                orderInfo.OrderNO = orderNo;
                orderInfo.MerchandiseName = GameName;
                orderInfo.Currency = "CNY";
                orderInfo.Amount = Amount;
                orderInfo.PassportID = Account;
                orderInfo.RetailID = RetailID;
                orderInfo.PayStatus = 2;
                orderInfo.GameID = game;
                orderInfo.ServerID = Server;
                orderInfo.GameName = GameName;
                orderInfo.ServerName = ServerName;
                orderInfo.GameCoins = Silver;
                orderInfo.SendState = 1;
                orderInfo.PayType = "0004";
                orderInfo.Signature = "123456";
                orderInfo.DeviceID = MemberMac;
                OrderFormBLL obll = new OrderFormBLL();
                obll.Add(orderInfo);
                TraceLog.ReleaseWrite("AppStore充值完成");
            }
            catch (Exception ex)
            {
                TraceLog.ReleaseWriteFatal(ex.ToString());
            }
        }
Esempio n. 12
0
        /// <summary>
        /// appstroe充值
        /// </summary>
        /// <param name="gameId">Game.</param>
        /// <param name="serverId">Server.</param>
        /// <param name="passportId">Account.</param>
        /// <param name="coins">Coins.</param>
        /// <param name="amount">Amount.</param>
        /// <param name="orderNo">Order no.</param>
        /// <param name="retailId">Retail I.</param>
        /// <param name="deviceId">Member mac.</param>
        /// <param name="payState"></param>
        /// <param name="userId"></param>
        public static void AppStorePay(int gameId, int serverId, string passportId, int coins, int amount, string orderNo, string retailId, string deviceId, bool payState = true, string userId = "") {
            try {
                string gameName = string.Empty;
                string serverName = string.Empty;
                ServerInfo serverinfo = GetServerData(gameId, serverId);
                if (serverinfo != null) {
                    gameName = serverinfo.GameName;
                    serverName = serverinfo.Name;
                }

                OrderInfo orderInfo = new OrderInfo();
                orderInfo.OrderNo = orderNo;
                orderInfo.MerchandiseName = gameName;
                orderInfo.Currency = "CNY";
                orderInfo.Amount = amount;
                orderInfo.PassportId = passportId;
                orderInfo.Expand = userId;
                orderInfo.RetailId = retailId;
                orderInfo.PayStatus = payState ? 2 : 3;
                orderInfo.GameId = gameId;
                orderInfo.ServerId = serverId;
                orderInfo.GameName = gameName;
                orderInfo.ServerName = serverName;
                orderInfo.GameCoins = coins;
                orderInfo.SendState = 1;
                orderInfo.PayType = "0004";
                orderInfo.Signature = "123456";
                orderInfo.DeviceId = deviceId;
                OrderFormBLL obll = new OrderFormBLL();
                obll.Add(orderInfo);
                TraceLog.ReleaseWrite("User:{0} AppStore充值{1}完成,order:{2}", passportId, amount, orderNo);
            } catch (Exception ex) {
                TraceLog.ReleaseWriteFatal("User:{0} AppStore充值{1}异常, order:{2}\r\nError:{3}", passportId, amount, orderNo, ex.ToString());
            }
        }
Esempio n. 13
0
        /// <summary>
        /// 处理礼包
        /// </summary>
        /// <param name="userID"></param>
        /// <param name="order"></param>
        private static void DoGiff(string userID, OrderInfo order)
        {
            int packType = 0;
            List<PackageReceive> packageReceivess = new List<PackageReceive>();
            UserRechargeLog rechargeLog = new UserRechargeLog
            {
                LogID = Guid.NewGuid().ToString(),
                UserID = userID,
                OrderNo = order.OrderNO,
                ChargeAmount = order.Amount,
                PayGold = order.GameCoins,
                ReargeDate = DateTime.Now

            };
            var sender = DataSyncManager.GetDataSender();
            sender.Send(rechargeLog);

            UserRecharge recharge = new GameDataCacheSet<UserRecharge>().FindKey(userID);
            if (recharge == null)
            {
                recharge = new UserRecharge() { UserID = userID };
            }
            //处理充值活动
            recharge.LastNum = order.GameCoins;
            TriggerFestivalPack(recharge, order.GameCoins);
            if (IsCurrentWeek(recharge.ChargeDate))
            {
                recharge.WeekNum = MathUtils.Addition(recharge.WeekNum, order.GameCoins, int.MaxValue);
            }
            else
            {
                recharge.WeekNum = order.GameCoins;
            }
            if (recharge.ChargeDate.Month == DateTime.Now.Month)
            {
                recharge.MonthNum = MathUtils.Addition(recharge.MonthNum, order.GameCoins, int.MaxValue);
            }
            else
            {
                recharge.MonthNum = order.GameCoins;
            }

            recharge.TotalGoldNum = MathUtils.Addition(recharge.TotalGoldNum, order.GameCoins, int.MaxValue);
            recharge.ChargeDate = DateTime.Now;
            var rechargeCacheSet = new GameDataCacheSet<UserRecharge>();
            if (rechargeCacheSet.FindKey(userID) == null)
            {
                packType = 1;
                recharge.FirstNum = order.GameCoins;
                TriggerReceivePack(userID, packType, recharge.FirstNum);
                rechargeCacheSet.Add(recharge, GameEnvironment.CacheUserPeriod);
                FestivalHelper.GetFirstReward(userID, FestivalType.FirstReward);
                GameUser userInfo = new GameDataCacheSet<GameUser>().FindKey(userID);
                if (userInfo != null)
                {
                    FestivalHelper.GetPayReward(userInfo, order.GameCoins, FestivalType.FirstPayDoubleSpar);
                }
            }

            //触发总累计充值礼包
            packType = 2;
            TriggerReceivePack(userID, packType, recharge.TotalGoldNum);
            List<RechargePacks> rechargePackseArray = new ConfigCacheSet<RechargePacks>().FindAll(m => m.PacksType == packType);
            foreach (RechargePacks rechargePackse in rechargePackseArray)
            {
                RemoveCharge(userID, rechargePackse.PacksID);
            }
            TriggerWeekPack(userID, recharge.WeekNum); //每周礼包
            TriggerMonthPack(userID, recharge.MonthNum); //每月礼包
        }
Esempio n. 14
0
        internal bool PaySuccess(string orderNo, OrderInfo orderInfo)
        {
            var command = ConfigManger.Provider.CreateCommandStruct("OrderInfo", CommandMode.Modify);
            orderInfo.PayStatus = 2;
            command.AddParameter("PayStatus", orderInfo.PayStatus);
            if (!string.IsNullOrEmpty(orderInfo.PayType))
            {
                command.AddParameter("PayType", orderInfo.PayType);
            }
            if (orderInfo.Amount > 0 && orderInfo.GameCoins > 0)
            {
                command.AddParameter("Amount", orderInfo.Amount);
                command.AddParameter("GameCoins", orderInfo.GameCoins);
            }
            command.Filter = ConfigManger.Provider.CreateCommandFilter();
            command.Filter.Condition = command.Filter.FormatExpression("OrderNO");
            command.Filter.AddParam("OrderNO", orderNo);
            command.Parser();

            return ConfigManger.Provider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters) > 0;
        }
Esempio n. 15
0
        /// <summary>
        /// Updates the by91.
        /// </summary>
        /// <returns><c>true</c>, if by91 was updated, <c>false</c> otherwise.</returns>
        /// <param name="model">Model.</param>
        /// <param name="callback">If set to <c>true</c> callback.</param>
        public bool UpdateBy91(OrderInfo model, bool callback)
        {
            var command = ConfigManger.Provider.CreateCommandStruct("OrderInfo", CommandMode.Modify);
            if (callback)
            {
                command.AddParameter("MerchandiseName", model.MerchandiseName);
                command.AddParameter("PayType", model.PayType);
                command.AddParameter("Amount", model.Amount);
                command.AddParameter("SendState", model.SendState);
                command.AddParameter("PayStatus", model.PayStatus);
                command.AddParameter("GameCoins", model.GameCoins);
                command.AddParameter("Signature", model.Signature);
            }
            else
            {
                command.AddParameter("ServerID", model.ServerID);
                command.AddParameter("PassportID", model.PassportID);
                if (!string.IsNullOrEmpty(model.Expand))
                    command.AddParameter("Expand", model.Expand);
                command.AddParameter("GameID", model.GameID);
                command.AddParameter("RetailID", model.RetailID);//20

                if (!string.IsNullOrEmpty(model.ServerName))
                {
                    command.AddParameter("ServerName", model.ServerName);
                }
                if (!string.IsNullOrEmpty(model.GameName))
                {
                    command.AddParameter("gameName", model.GameName);
                }
            }
            command.Filter = ConfigManger.Provider.CreateCommandFilter();
            command.Filter.Condition = command.Filter.FormatExpression("OrderNO");
            command.Filter.AddParam("OrderNO", model.OrderNO);
            command.Parser();
            return ConfigManger.Provider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters) > 0;

        }
Esempio n. 16
0
 private OrderInfo SetOrderInfo(IDataReader reader)
 {
     OrderInfo ordermode = new OrderInfo();
     ordermode.OrderNO = reader["OrderNO"].ToNotNullString();
     ordermode.MerchandiseName = reader["MerchandiseName"].ToNotNullString();
     ordermode.PayType = reader["PayType"].ToNotNullString();
     ordermode.Amount = reader["Amount"].ToDecimal();
     ordermode.Currency = reader["Currency"].ToNotNullString();
     ordermode.Expand = reader["Expand"].ToNotNullString();
     ordermode.SerialNumber = reader["SerialNumber"].ToNotNullString();
     ordermode.PassportID = reader["PassportID"].ToNotNullString();
     ordermode.ServerID = reader["ServerID"].ToInt();
     ordermode.GameID = reader["GameID"].ToInt();
     ordermode.GameName = reader["gameName"].ToNotNullString();
     ordermode.ServerName = reader["ServerName"].ToNotNullString();
     ordermode.PayStatus = reader["PayStatus"].ToInt();
     ordermode.Signature = reader["Signature"].ToNotNullString();
     ordermode.Remarks = reader["Remarks"].ToNotNullString();
     ordermode.GameCoins = reader["GameCoins"].ToInt();
     ordermode.SendState = reader["SendState"].ToInt();
     ordermode.CreateDate = reader["CreateDate"].ToDateTime();
     ordermode.SendDate = reader["SendDate"].ToDateTime();
     ordermode.RetailID = reader["RetailID"].ToNotNullString();
     ordermode.DeviceID = reader["DeviceID"].ToNotNullString();
     return ordermode;
 }
Esempio n. 17
0
        private void Check10086Payment(OrderInfo orderInfo)
        {
            string url = "http://ospd.mmarket.com:8089/trust";
            string appId = "";
            string version = "1.0.0";
            int orderType = 1;
            GameChannel gameChannel = ZyGameBaseConfigManager.GameSetting.GetChannelSetting(ChannelType.channelMIUI);
            if (gameChannel != null)
            {
                url = gameChannel.Url;
                version = gameChannel.Version;
                orderType = gameChannel.CType.ToInt();
                GameSdkSetting setting = gameChannel.GetSetting(orderInfo.PayType);
                if (setting != null)
                {
                    appId = setting.AppId;
                }
                else
                {
                    return;
                }
            }

            StringBuilder paramData = new StringBuilder();
            paramData.Append("<?xml version=\"1.0\"?>");
            paramData.AppendFormat("<Trusted2ServQueryReq>");
            paramData.AppendFormat("<MsgType>{0}</MsgType>", "Trusted2ServQueryReq");
            paramData.AppendFormat("<Version>{0}</Version>", version);
            paramData.AppendFormat("<AppID>{0}</AppID>", appId);
            paramData.AppendFormat("<OrderID>{0}</OrderID>", orderInfo.OrderNO);
            paramData.AppendFormat("<OrderType>{0}</OrderType>", orderType);
            paramData.AppendFormat("</Trusted2ServQueryReq>");
            HttpRequest request = new HttpRequest();
            request.Post(HttpRequest.ContentTypeXml, url, paramData.ToString(), stream =>
            {
                try
                {
                    var doc = request.ToXml(stream);
                    TraceLog.ReleaseWriteFatal("10068 order:{0} response:{1}", orderInfo.OrderNO, doc.InnerXml);
                    var returnCode = doc.SelectSingleNode("Trusted2ServQueryResp/ReturnCode");
                    if (returnCode != null && !string.IsNullOrEmpty(returnCode.InnerText))
                    {
                        int code = returnCode.InnerText.ToInt();
                        if (code == 0)
                        {
                            string orderNo = "";
                            var orderIDNode = doc.SelectSingleNode("Trusted2ServQueryResp/OrderID");
                            if (orderIDNode != null)
                            {
                                orderNo = orderIDNode.InnerText;
                            }
                            var priceNode = doc.SelectSingleNode("Trusted2ServQueryResp/TotalPrice");
                            if (priceNode != null)
                            {
                                decimal amount = priceNode.InnerText.ToDecimal();
                                orderInfo.Amount = amount;
                                orderInfo.GameCoins = (int)amount * 10;
                            }
                            return PayManager.PaySuccess(orderNo, orderInfo);
                        }
                        TraceLog.ReleaseWriteFatal("10086 payment order:{0} fail code:{1}", orderInfo.OrderNO, code);
                    }
                }
                catch (Exception ex)
                {
                    TraceLog.WriteError("10086 payment error:", ex);
                }
                return false;
            });
        }
Esempio n. 18
0
 private void DoSuccess(OrderInfo orderInfo)
 {
     //移动MM SDK
     Check10086Payment(orderInfo);
 }
Esempio n. 19
0
        /// <summary>
        /// 子类实现Action处理
        /// </summary>
        /// <returns></returns>
        public override bool TakeAction() {
            OrderInfo orderInfo = new OrderInfo();
            orderInfo.OrderNo = orderNo;
            orderInfo.MerchandiseName = productId;
            orderInfo.Currency = currency;
            orderInfo.Amount = amount;
            orderInfo.PassportId = passportId;
            orderInfo.RetailId = retailId;
            orderInfo.PayStatus = 1;
            orderInfo.GameId = gameId;
            orderInfo.ServerId = serverId;
            orderInfo.GameName = gameName;
            orderInfo.ServerName = serverName;
            orderInfo.GameCoins = (amount * 10).ToInt();
            orderInfo.SendState = 1;
            orderInfo.PayType = payType;
            orderInfo.Signature = "000000";
            orderInfo.DeviceId = deviceId;

            if (PayManager.AddOrder(orderInfo)) {
                DoSuccess(orderInfo);
                payStatus = orderInfo.PayStatus;
                TraceLog.ReleaseWriteFatal(string.Format("PayNormal Order:{0},pid:{1} successfully!", orderNo, passportId));
                return true;
            }
            ErrorCode = Language.Instance.ErrorCode;
            ErrorInfo = Language.Instance.AppStorePayError;
            TraceLog.ReleaseWriteFatal(string.Format("PayNormal Order:{0},pid:{1} faild!", orderNo, passportId));
            return false;
        }
Esempio n. 20
0
        /// <summary>
        /// 触控android订单
        /// </summary>
        /// <param name="orderNo"></param>
        /// <param name="amount"></param>
        /// <param name="passportid"></param>
        /// <param name="serverID"></param>
        /// <param name="gameID"></param>
        /// <param name="gameConis"></param>
        /// <param name="deviceid"></param>
        /// <param name="RetailID"></param>
        public static void AddOrderInfo(string orderNo, decimal amount, string passportid, int serverID, int gameID, int gameConis, string deviceid, string RetailID)
        {
            try
            {
                string GameName = string.Empty;
                string ServerName = string.Empty;
                ServerInfo serverinfo = GetServerData(gameID, serverID);
                if (serverinfo != null)
                {
                    GameName = serverinfo.GameName;
                    ServerName = serverinfo.Name;
                }

                OrderInfo orderInfo = new OrderInfo();
                orderInfo.OrderNO = orderNo;
                orderInfo.MerchandiseName = GameName;
                orderInfo.Currency = "CNY";
                orderInfo.Amount = amount;
                orderInfo.PassportID = passportid;
                orderInfo.RetailID = RetailID;
                orderInfo.PayStatus = 1;
                orderInfo.GameID = gameID;
                orderInfo.ServerID = serverID;
                orderInfo.GameName = GameName;
                orderInfo.ServerName = ServerName;
                orderInfo.GameCoins = gameConis;
                orderInfo.SendState = 1;
                orderInfo.PayType = "6002";
                orderInfo.Signature = "123456";
                orderInfo.DeviceID = deviceid;
                OrderFormBLL obll = new OrderFormBLL();
                obll.Add91Pay(orderInfo, false);
                TraceLog.ReleaseWrite("触控android充值完成");
            }
            catch (Exception ex)
            {
                TraceLog.ReleaseWriteFatal(ex.ToString());
            }
        }
Esempio n. 21
0
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool Update(OrderInfo model)
        {
            CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Modify);
            command.AddParameter("SerialNumber", SqlDbType.VarChar, model.SerialNumber);
            command.AddParameter("PayStatus", SqlDbType.Int, model.PayStatus);
            command.AddParameter("@Signature", SqlDbType.VarChar, 0, model.Signature);
            command.Filter = new CommandFilter();
            command.Filter.Condition = "OrderNO=@OrderNO";
            command.Filter.AddParam("@OrderNO", SqlDbType.VarChar, 0, model.OrderNO);
            command.Parser();

            int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters);
            return rows > 0;
        }
Esempio n. 22
0
        internal bool PaySuccess(string orderNo, OrderInfo orderInfo)
        {
            CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Modify);
            orderInfo.PayStatus = 2;
            command.AddParameter("PayStatus", SqlDbType.Int, orderInfo.PayStatus);
            if (!string.IsNullOrEmpty(orderInfo.PayType))
            {
                command.AddParameter("PayType", SqlDbType.VarChar, orderInfo.PayType);
            }
            if (orderInfo.Amount > 0 && orderInfo.GameCoins > 0)
            {
                command.AddParameter("Amount", SqlDbType.Decimal, orderInfo.Amount);
                command.AddParameter("GameCoins", SqlDbType.Int, orderInfo.GameCoins);
            }
            command.Filter = new CommandFilter();
            command.Filter.Condition = "OrderNO=@OrderNO";
            command.Filter.AddParam("@OrderNO", SqlDbType.VarChar, 0, orderNo);
            command.Parser();

            int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters);
            return rows > 0;
        }
Esempio n. 23
0
 /// <summary>
 /// Updates the by91.
 /// </summary>
 /// <returns><c>true</c>, if by91 was updated, <c>false</c> otherwise.</returns>
 /// <param name="model">Model.</param>
 /// <param name="callback">If set to <c>true</c> callback.</param>
 public bool UpdateBy91(OrderInfo model, bool callback)
 {
     CommandStruct command = new CommandStruct("OrderInfo", CommandMode.Modify);
     if (callback)
     {
         command.AddParameter("MerchandiseName", SqlDbType.VarChar, model.MerchandiseName);
         command.AddParameter("PayType", SqlDbType.VarChar, model.PayType);
         command.AddParameter("Amount", SqlDbType.Decimal, model.Amount);
         command.AddParameter("SendState", SqlDbType.Int, model.SendState);
         command.AddParameter("PayStatus", SqlDbType.Int, model.PayStatus);
         command.AddParameter("GameCoins", SqlDbType.Int, model.GameCoins);
         command.AddParameter("Signature", SqlDbType.VarChar, model.Signature);
     }
     else
     {
         command.AddParameter("ServerID", SqlDbType.Int, model.ServerID);
         command.AddParameter("PassportID", SqlDbType.VarChar, model.PassportID);
         command.AddParameter("GameID", SqlDbType.Int, model.GameID);
         command.AddParameter("RetailID", SqlDbType.VarChar, model.RetailID);//20
         //修改了服务器名称为空写库的BUG panx 2012-11-26
         if (!string.IsNullOrEmpty(model.ServerName))
         {
             command.AddParameter("ServerName", SqlDbType.VarChar, model.ServerName);
         }
         //修改了游戏名称为空写库的BUG panx 2012-11-26
         if (!string.IsNullOrEmpty(model.GameName))
         {
             command.AddParameter("gameName", SqlDbType.VarChar, model.GameName);
         }
     }
     command.Filter = new CommandFilter();
     command.Filter.Condition = "OrderNO=@OrderNO";
     command.Filter.AddParam("@OrderNO", SqlDbType.VarChar, 0, model.OrderNO);
     command.Parser();
     int rows = SqlHelper.ExecuteNonQuery(ConfigManger.connectionString, CommandType.Text, command.Sql, command.SqlParameters);
     return rows > 0;
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="userId"></param>
 /// <param name="orderInfo"></param>
 /// <returns></returns>
 protected abstract bool DoNotify(int userId, OrderInfo orderInfo);
Esempio n. 25
0
        private void Check10086Payment(OrderInfo orderInfo)
        {
            string url = "http://ospd.mmarket.com:8089/trust";
            string appId = "";
            string version = "1.0.0";
            int orderType = 1;
            var section = SdkSectionFactory.Section10086;
            if (section != null && !string.IsNullOrEmpty(orderInfo.PayType))
            {
                url = section.Url;
                version = section.Version;
                orderType = section.OrderType;
                Channel10086Element channel10086 = section.Channels[orderInfo.PayType];
                if (channel10086 != null)
                {
                    appId = channel10086.AppId;
                }
                else
                {
                    return;
                }
            }
            StringBuilder paramData = new StringBuilder();
            paramData.Append("<?xml version=\"1.0\"?>");
            paramData.AppendFormat("<Trusted2ServQueryReq>");
            paramData.AppendFormat("<MsgType>{0}</MsgType>", "Trusted2ServQueryReq");
            paramData.AppendFormat("<Version>{0}</Version>", version);
            paramData.AppendFormat("<AppID>{0}</AppID>", appId);
            paramData.AppendFormat("<OrderID>{0}</OrderID>", orderInfo.OrderNO);
            paramData.AppendFormat("<OrderType>{0}</OrderType>", orderType);
            paramData.AppendFormat("</Trusted2ServQueryReq>");
            HttpRequest request = new HttpRequest();
            request.Post(HttpRequest.ContentTypeXml, url, paramData.ToString(), stream =>
            {
                try
                {
                    /****************************************************************************
            Copyright (c) 2013-2015 scutgame.com

            http://www.scutgame.com

            Permission is hereby granted, free of charge, to any person obtaining a copy
            of this software and associated documentation files (the "Software"), to deal
            in the Software without restriction, including without limitation the rights
            to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
            copies of the Software, and to permit persons to whom the Software is
            furnished to do so, subject to the following conditions:

            The above copyright notice and this permission notice shall be included in
            all copies or substantial portions of the Software.

            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
            IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
            FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
            AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
            LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
            OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
            THE SOFTWARE.
            ****************************************************************************/
                    var doc = request.ToXml(stream);
                    TraceLog.ReleaseWriteFatal("10068 order:{0} response:{1}", orderInfo.OrderNO, doc.InnerXml);
                    var returnCode = doc.SelectSingleNode("Trusted2ServQueryResp/ReturnCode");
                    if (returnCode != null && !string.IsNullOrEmpty(returnCode.InnerText))
                    {
                        int code = returnCode.InnerText.ToInt();
                        if (code == 0)
                        {
                            string orderNo = "";
                            var orderIDNode = doc.SelectSingleNode("Trusted2ServQueryResp/OrderID");
                            if (orderIDNode != null)
                            {
                                orderNo = orderIDNode.InnerText;
                            }
                            var priceNode = doc.SelectSingleNode("Trusted2ServQueryResp/TotalPrice");
                            if (priceNode != null)
                            {
                                decimal amount = priceNode.InnerText.ToDecimal();
                                orderInfo.Amount = amount;
                                orderInfo.GameCoins = (int)amount * 10;
                            }
                            return PayManager.PaySuccess(orderNo, orderInfo);
                        }
                        TraceLog.ReleaseWriteFatal("10086 payment order:{0} fail code:{1}", orderInfo.OrderNO, code);
                    }
                }
                catch (Exception ex)
                {
                    TraceLog.WriteError("10086 payment error:", ex);
                }
                return false;
            });
        }