Example #1
0
        public IHttpActionResult DwSetup([FromBody] DwInitialSetupRequest dwInitialSetupReq)
        {
            dwInitialSetupReq.ThrowIfNull(nameof(dwInitialSetupReq));
            var resp = _internalBusiness.DwInitialSetup(dwInitialSetupReq);

            return(Ok(resp));
        }
Example #2
0
        public AcApiResponse <DwInitialSetupResponse, ApiData> DwInitialSetup(DwInitialSetupRequest req)
        {
            var resp = agentConnectIntegration.DwInitialSetup(req);

            var apiResp = new AcApiResponse <DwInitialSetupResponse, ApiData>
            {
                BusinessMetadata = MapperHelper.SetResponseProperties(resp.Payload?.Flags, DataSource.AgentConnect),
                ResponseData     = resp
            };

            return(apiResp);
        }
        public DwInitialSetupResponse DwInitialSetup(DwInitialSetupRequest dwInitialSetupRequest)
        {
            var agent = AuthIntegration.GetAgent();

            if (dwInitialSetupRequest.DeviceID == null)
            {
                dwInitialSetupRequest.DeviceID = AuthIntegration.GetDeviceId();
            }
            // Map values of DeviceID and Device setup PIN to AgentId and Password
            agent.AgentId       = dwInitialSetupRequest.DeviceID;
            agent.AgentSequence = string.Empty;
            agent.AgentPassword = dwInitialSetupRequest.Password;

            var response = _agentConnect.DwInitialSetup(agent, dwInitialSetupRequest);

            CheckFlagsForDataChange(response.Payload?.Flags, agent);
            return(response);
        }
Example #4
0
        public DwRegisterDeviceRespVm DwRegisterDevice(DwRegisterDeviceReqVm registerDeviceReqVm)
        {
            var dwInitialreq = new DwInitialSetupRequest
            {
                DeviceID = registerDeviceReqVm.DeviceId,
                Password = registerDeviceReqVm.SetupPin,
                ClientSoftwareVersion = registerDeviceReqVm.ClientSoftwareVersion,
                PoeType        = registerDeviceReqVm.PoeType,
                ChannelType    = registerDeviceReqVm.ChannelType,
                TargetAudience = registerDeviceReqVm.TargetAudience
            };

            var dwSetup = DwInitialSetup(dwInitialreq);
            var xDoc    = XDocument.Parse(dwSetup.ResponseData.Payload.Profile);

            registerDeviceReqVm.MgiDeviceSession = registerDeviceReqVm.MgiDeviceSession;
            registerDeviceReqVm.PosUnitProfileId = int.Parse(GetValue(xDoc, "PROFILE_ID").FirstOrDefault().Value);

            var dwregisterDeviceReqVm = registerDeviceReqVm.ToModel();
            var resp = openIdmIntegration.RegisterDevice(dwregisterDeviceReqVm);

            return(new DwRegisterDeviceRespVm
            {
                AgentLocationId = AuthIntegration.GetAgent().AgentId,
                MainOfficeId = AuthIntegration.GetMainOfficeId(),
                AgentName = resp == true?GetValue(xDoc, "AGENT_NAME").FirstOrDefault().Value : string.Empty,
                AgentAddress1 = resp == true?GetValue(xDoc, "AGENT_ADDRESS_1").FirstOrDefault().Value : string.Empty,
                AgentAddress2 = resp == true?GetValue(xDoc, "AGENT_ADDRESS_2").FirstOrDefault().Value : string.Empty,
                AgentAddress3 = resp == true?GetValue(xDoc, "AGENT_ADDRESS_3").FirstOrDefault().Value : string.Empty,
                AgentCity = resp == true?GetValue(xDoc, "AGENT_CITY").FirstOrDefault().Value : string.Empty,
                AgentState = resp == true?GetValue(xDoc, "AGENT_STATE").FirstOrDefault().Value : string.Empty,
                AgentZip = resp == true?GetValue(xDoc, "AGENT_ZIP").FirstOrDefault().Value : string.Empty,
                AgentPhoneNumber = resp == true?GetValue(xDoc, "AGENT_PHONE").FirstOrDefault().Value : string.Empty,
                AgentCountry = resp == true?GetValue(xDoc, "AGENT_COUNTRY").FirstOrDefault().Value : string.Empty,
                AgentTimeZone = resp == true?GetValue(xDoc, "AGENT_TIME_ZONE").FirstOrDefault().Value : string.Empty,
                Success = resp
            });
        }
Example #5
0
 public virtual async Task <DwInitialSetupResponse> DwInitialSetupAsync(Agent agent, DwInitialSetupRequest dwInitialSetupRequest)
 {
     return(await AgentConnect.DwInitialSetupAsync(agent, dwInitialSetupRequest));
 }
Example #6
0
 public virtual DwInitialSetupResponse DwInitialSetup(Agent agent, DwInitialSetupRequest dwInitialSetupRequest)
 {
     return(AgentConnect.DwInitialSetup(agent, dwInitialSetupRequest));
 }