Beispiel #1
0
        private string OrderPay(string FW_GOODS, string nick)
        {
            ITopClient             client = TBManager.GetClient();
            VasSubscribeGetRequest req    = new VasSubscribeGetRequest();

            req.ArticleCode = FW_GOODS;
            req.Nick        = nick;
            VasSubscribeGetResponse rsp = client.Execute(req);

            return(rsp.Body);
        }
Beispiel #2
0
        /// <summary>
        /// 取得用户的订购信息,收费代码和到期时间,使用"|"分隔
        /// </summary>
        public String GetUserVas(EntityUser session, ref string message)
        {
            string userSubscribe      = string.Empty;
            string cacheKey_subscribe = "tkci_user_subscribe_" + session.fSubUserName;
            int    cacheTimeOut       = 30 * 60; //缓存30分钟

            WService.WebServiceForKeywordForecast wsProxy = new WService.WebServiceForKeywordForecast();
            try
            {
                userSubscribe = wsProxy.GetValueTimeOut(cacheKey_subscribe);
                if (!string.IsNullOrEmpty(userSubscribe))
                {
                    return(userSubscribe);
                }
            }
            catch (Exception se)
            {
                logger.Error("缓存获取用户收费代码失败", se);
            }

            VasSubscribeGetResponse response = CommonHandler.DoTaoBaoApi <VasSubscribeGetResponse>(bllTaoBaoApi.TaobaoSimbaSvaGet, session);

            if (response.IsError)
            {
                message = response.SubErrMsg;
                logger.ErrorFormat("API获取用户收费代码失败,{0}", response.Body);
            }
            else
            {
                if (response != null && response.ArticleUserSubscribes != null && response.ArticleUserSubscribes.Count > 0)
                {
                    string itemCode = string.Join(",", response.ArticleUserSubscribes.Select(o => o.ItemCode).ToArray());
                    string deadLine = string.Join(",", response.ArticleUserSubscribes.Select(o => o.Deadline).ToArray());
                    userSubscribe = itemCode + "|" + deadLine;
                    try
                    {
                        wsProxy.SetValueTimeOut(cacheKey_subscribe, userSubscribe, cacheTimeOut);
                    }
                    catch (Exception se)
                    {
                        logger.Error("缓存设置用户收费代码失败", se);
                    }
                }
            }


            return(userSubscribe);
        }
Beispiel #3
0
 public static VasSubscribeGetResponse GetSellerSubscrib(string sellerNick, string articleCode)
 {
     try
     {
         ITopClient             client = TBManager.GetClient();
         VasSubscribeGetRequest req    = new VasSubscribeGetRequest();
         req.Nick        = sellerNick;
         req.ArticleCode = articleCode;
         VasSubscribeGetResponse response = client.Execute(req);
         return(response);
     }
     catch (Exception ex)
     {
         ExceptionReporter.WriteLog(ex, ExceptionPostion.TopApi);
         return(null);
     }
 }
Beispiel #4
0
 public static ArticleUserSubscribe GetDeadLineDate(string articleCode, string sellerNick)
 {
     try
     {
         VasSubscribeGetResponse response = UserSubscribes.GetSellerSubscrib(sellerNick, articleCode);
         if (response != null && response.ArticleUserSubscribes != null && response.ArticleUserSubscribes.Count > 0)
         {
             return(response.ArticleUserSubscribes[0]);
         }
     }
     catch (Exception ex)
     {
         //ExceptionReporter.WriteLog(ex, ExceptionPostion.TBApply_Components);
         return(null);
     }
     return(null);
 }