Exemple #1
0
        public IResponseBase Execute(IRequestParameter parameters)
        {
            try
            {
                if (null == parameters)
                {
                    parameters = new InitRequest();
                }

                RequestHeaderHelper.GetClientIP(_core);
                _request = (InitRequest)parameters;
                GetDashByDate();
                GetCartDetails();
                GetCheckout();
                SetMenuAndBrands();
                SetSessionInfo();
                SetPingdomStatus();
                //SetLatLonPosition();
                SetEnvironment();
            }
            catch (Exception ex)
            {
                string errorMsg = string.Format("({0}){1}", ex.Message, ex.StackTrace);
                _result.errors.Add(ex.Handle("Init: " + errorMsg, ErrorSeverity.FollowUp, ErrorType.RequestError));
            }
            //FIX ME:CPEREZ. Make me a stand along service to be call from front-end
            _result.resultset.GeoLat = 0;
            _result.resultset.GeoLon = 0;
            return(_result);
        }
Exemple #2
0
        public override void RebuildRequest()
        {
            OverrideUserAgent = Config.Params.UserAgent;
            OverrideUseSgmlReaderForConversion            = false;
            OverrideUseCorsisForConversion                = true;
            OverrideUseRemoteCorsisForConversion          = true;
            OverrideUseCustomAttributesInCorsisConversion = true;
            OverrideExpect100               = true;
            OverrideSecurityProtocol        = SecurityProtocolType.Tls11;
            OptionalPreserveOriginalRawData = true;

            Headers.Add("Authorization", "Basic c3RvcmVmcm9udDpyZXZvbHV0aW9u");
            Headers.Add(Config.Params.ClientIPHeader, RequestHeaderHelper.GetClientIP(Core));
            base.RebuildRequest();
        }
Exemple #3
0
 private void SetSessionInfo()
 {
     try
     {
         _result.resultset.ClientIP = RequestHeaderHelper.GetClientIP(_core);
         _result.resultset.ID       = EnvironmentHelper.GetLastIPAddressOctet();
         if (_core.Context.Session != null)
         {
             _result.resultset.SessionID = _core.Context.Session.SessionID;
         }
     }
     catch (Exception ex)
     {
         _result.errors.Add(ex.Handle("Init.SetSessionInfo: " + ex, ErrorSeverity.FollowUp, ErrorType.RequestError));
     }
 }