コード例 #1
0
        public static string GetComputerName(string agentId, string posId, IPartnerServiceIntegration _partnerIntegration)
        {
            var     request = new AgentsDeviceNamesRequest();
            decimal agent   = decimal.Parse(agentId);
            decimal pos     = decimal.Parse(posId);

            if (string.IsNullOrEmpty(agentId) || string.IsNullOrEmpty(posId))
            {
                return(string.Empty);
            }

            MoneyGram.PartnerService.DomainModel.Header header = new MoneyGram.PartnerService.DomainModel.Header();
            MoneyGram.PartnerService.DomainModel.ProcessingInstruction processingInstruction = new MoneyGram.PartnerService.DomainModel.ProcessingInstruction();

            processingInstruction.Action = "GetAgentsDeviceNames";
            processingInstruction.RollbackTransaction = false;

            header.ProcessingInstruction = processingInstruction;
            request.header = header;

            var poslist = new List <MoneyGram.PartnerService.DomainModel.AgentPosDevice>();

            poslist.Add(new MoneyGram.PartnerService.DomainModel.AgentPosDevice()
            {
                AgentId = agent, PosNumber = pos, PosNumberFieldSpecified = true
            });
            request.AgentPosDeviceList = poslist;
            var resp = _partnerIntegration.GetAgentsDeviceNames(request);

            if (resp.AgentPosDeviceListResult == null)
            {
                return("-");
            }
            return(resp.AgentPosDeviceListResult.Find(x => x.Name != string.Empty).Name);
        }
コード例 #2
0
        /// <summary>
        /// Returns agentsDeviceNamesResponse for the PartnerService Request...
        /// </summary>
        /// <param name="agentsDeviceNamesRequest">agentsDeviceNamesRequest</param>
        /// <returns>agentsDeviceNamesResponse</returns>
        public async Task <AgentsDeviceNamesResponse> GetAgentsDeviceNamesAsync(AgentsDeviceNamesRequest agentsDeviceNamesRequest)
        {
            agentsDeviceNamesRequest.ThrowIfNull(nameof(agentsDeviceNamesRequest));

            var deviceNamesResponse = await PartnerServiceProxyFactory.UseService(service => service.getAgentsDeviceNamesAsync(agentsDeviceNamesRequest.ToAgentsDeviceNamesRequest1Service()));

            return(deviceNamesResponse.getAgentsDeviceNamesResponse.ToDomain());
        }
コード例 #3
0
        public AgentsDeviceNamesResponse GetAgentsDeviceNames(AgentsDeviceNamesRequest agentsDeviceNamesRequest)
        {
            Task <AgentsDeviceNamesResponse> task = Task.Run(() => this.GetAgentsDeviceNamesAsync(agentsDeviceNamesRequest));

            task.Wait();

            return(task.Result);
        }
コード例 #4
0
 public virtual AgentsDeviceNamesResponse GetAgentsDeviceNames(AgentsDeviceNamesRequest agentsDeviceNamesRequest)
 {
     return(_partnerService.GetAgentsDeviceNames(agentsDeviceNamesRequest));
 }
コード例 #5
0
 public Task <AgentsDeviceNamesResponse> GetAgentsDeviceNamesAsync(AgentsDeviceNamesRequest agentsDeviceNamesRequest)
 {
     return(_partnerService.GetAgentsDeviceNamesAsync(agentsDeviceNamesRequest));
 }
コード例 #6
0
 public AgentsDeviceNamesResponse GetAgentsDeviceNames(AgentsDeviceNamesRequest agentsDeviceNamesRequest)
 {
     return(_partnerServiceRepository.GetAgentsDeviceNames(agentsDeviceNamesRequest));
 }