Example #1
0
        protected void BuildMessage(List <TrackItem> items, out string jsonStr, out string sign)
        {
            Dictionary <string, object> json = BuildTrackMessage(items);

            if (json == null)
            {
                jsonStr = "";
                sign    = "";
                return;
            }

            jsonStr = MTJSON.Serialize(json);
            // sign
            sign = MTSecurity.Md5Sum(jsonStr + signKey);
        }
Example #2
0
        public PurchaseBillingItem(string key, string appId, string userId, string channel, Dictionary <string, object> infos)
        {
            iapKey = key;

            Dictionary <string, object> jObject = new Dictionary <string, object>(3 + infos.Count);

            jObject.Add("appId", appId);
            jObject.Add("userId", userId);
            jObject.Add("channel", channel);
            foreach (string k in infos.Keys)
            {
                if (infos [k] == null)
                {
                    jObject.Add(k, "");
                }
                else
                {
                    jObject.Add(k, infos [k]);
                }
            }
            message = MTJSON.Serialize(jObject);
        }