示例#1
0
        void doAdd_finishOrder(string parm)
        {
            string [] theParms = parm.Split(',');
            string    orderId  = theParms[0];
            string    typeUser = theParms[1];
            var       payCache = new ShareCacheStruct <PayOrder>();
            PayOrder  payData  = payCache.Find((o) =>
            {
                if (orderId == o.ServerOrderId)
                {
                    return(true);
                }
                return(false);
            });

            if (null == payData)
            {
                ConsoleLog.showErrorInfo(0, "error doAdd_finishOrder:" + orderId);
            }

            payData.ModifyLocked(() =>
            {
                payData.state           = PayOrder.PayStatus.paySuccess;
                payData.process         = true;
                payData.typeUser        = typeUser;
                payData.hasGetPayReward = true;
            });

            addProductOnServer(payData);
        }
示例#2
0
        bool processCache(string orderId, bool bSuccess, string jrRet, bool hasGet)
        {
            // cache order
            var      payCache = new ShareCacheStruct <PayOrder>();
            PayOrder payData  = payCache.Find((o) =>
            {
                if (orderId == o.ServerOrderId)
                {
                    return(true);
                }
                return(false);
            });

            if (null == payData)
            {
                //ConsoleLog.showErrorInfo(0, "PayLog not find order:" + orderId);
                TraceLog.WriteError("PayLog not find order:" + orderId);
                return(false);
            }

            PayOrder.PayStatus payStatus = PayOrder.PayStatus.payFailed;
            if (bSuccess)
            {
                payStatus = PayOrder.PayStatus.paySuccess;
            }

            if (false == payData.process)
            {
                payData.ModifyLocked(() =>
                {
                    payData.userParms       = urlParams; // save ..
                    payData.the3rdOrderId   = order_id;  // dic["order_id"];
                    payData.state           = payStatus;
                    payData.process         = true;
                    payData.typeUser        = jrRet;
                    payData.hasGetPayReward = hasGet;
                });
            }

            //ConsoleLog.showNotifyInfo("process HttpPost:" + jrRet);
            //TraceLog.ReleaseWrite("process HttpPost:" + jrRet);

            return(true);
        }
示例#3
0
        void doAdd_order(string parm)
        {
            string[] strS     = parm.Split(',');
            string   ordderId = strS[0];
            int      stat     = int.Parse(strS[1]);
            var      cache    = new ShareCacheStruct <PayOrder>();
            PayOrder payData  = cache.Find((o) =>
            {
                return(o.ServerOrderId == ordderId);
            });

            if (payData == null)
            {
                ConsoleLog.showErrorInfo(0, "doAdd_order:" + ordderId);
                return;
            }

            payData.ModifyLocked(() => {
                ConsoleLog.showNotifyInfo(string.Format("payData state change {0}=>{1}", payData.state, stat));
                payData.state = (PayOrder.PayStatus)stat;
            });
        }
示例#4
0
        void doEnd_order()
        {
            string   orderId  = requestPack.infoExt;
            var      payCache = new ShareCacheStruct <PayOrder>();
            PayOrder payData  = payCache.Find((o) =>
            {
                if (orderId == o.ServerOrderId)
                {
                    return(true);
                }
                return(false);
            });

            if (payData == null)
            {
                responsePack.errorCode = (byte)Response1004Pack.EnumErrorCode.order_not_find;
            }

            payData.ModifyLocked(() => {
                payData.hasGetPayReward = true;
            });
            responsePack.errorCode = (byte)Response1004Pack.EnumErrorCode.ok;
        }