예제 #1
0
        public AgentPasswordResponse GetAgentPassword(AgentPasswordRequest AgentPasswordRequest)
        {
            Task <AgentPasswordResponse> task = Task.Run(() => this.GetAgentPasswordAsync(AgentPasswordRequest));

            task.Wait();

            return(task.Result);
        }
예제 #2
0
        /// <summary>
        /// Returns AgentPasswordResponse for the PartnerService Request...
        /// </summary>
        /// <param name="agentPasswordRequest">agentPasswordRequest</param>
        /// <returns>AgentPasswordResponse</returns>
        public async Task <AgentPasswordResponse> GetAgentPasswordAsync(AgentPasswordRequest agentPasswordRequest)
        {
            agentPasswordRequest.ThrowIfNull(nameof(agentPasswordRequest));

            var agentPasswordResponse = await PartnerServiceProxyFactory.UseService(service => service.getAgentPasswordAsync(agentPasswordRequest.ToService()));

            return(agentPasswordResponse.getAgentPasswordResponse.ToDomain());
        }
예제 #3
0
        public override AgentPasswordResponse GetAgentPassword(AgentPasswordRequest agentPasswordRequest)
        {
            AgentPasswordResponse agentPasswordResponse;
            var agentPasswordKeyFormatted = string.Format(CacheKeys.AGENTPASSWORDKEY, agentPasswordRequest.AgentId, agentPasswordRequest.PosNumber);

            var cachedResult = _cacheManager.Contains <CachedObjectResponseContainer <AgentPasswordResponse> >(agentPasswordKeyFormatted, CacheRegion.Global);

            if (cachedResult.Exists)
            {
                agentPasswordResponse = cachedResult.CachedObj.DataObject;
            }
            else
            {
                // Fetch payload and process
                agentPasswordResponse = base.GetAgentPassword(agentPasswordRequest);
                var agentPasswordCacheContainer = CacheAheadHelper.PopulateCacheMetadata <AgentPasswordResponse>(agentPasswordResponse, CachePolicies.FullWeek);
                // Cache it
                _cacheManager.Save(agentPasswordKeyFormatted, agentPasswordCacheContainer, CacheRegion.Global, CachePolicies.FullWeek);
            }
            return(agentPasswordResponse);
        }
예제 #4
0
        private string GetAgentPassword(string agentId, string posNumber)
        {
            var agentPasswordRequest = new AgentPasswordRequest
            {
                AgentId            = decimal.Parse(agentId),
                AgentIdSpecified   = true,
                PosNumber          = decimal.Parse(posNumber),
                PosNumberSpecified = true
            };

            var agentPasswordRequestHeader         = new Header();
            var agentPasswordProcessingInstruction = new ProcessingInstruction
            {
                Action = "GetAgentPassword",
                RollbackTransaction = false
            };

            agentPasswordRequestHeader.ProcessingInstruction = agentPasswordProcessingInstruction;
            agentPasswordRequest.header = agentPasswordRequestHeader;
            var getAgentPasswordResp = partnerServiceIntegration.GetAgentPassword(agentPasswordRequest);

            return(getAgentPasswordResp.AgentPassword);
        }
예제 #5
0
 public virtual AgentPasswordResponse GetAgentPassword(AgentPasswordRequest AgentPasswordRequest)
 {
     return(_partnerService.GetAgentPassword(AgentPasswordRequest));
 }
예제 #6
0
 public Task <AgentPasswordResponse> GetAgentPasswordAsync(AgentPasswordRequest AgentPasswordRequest)
 {
     return(_partnerService.GetAgentPasswordAsync(AgentPasswordRequest));
 }
예제 #7
0
 public AgentPasswordResponse GetAgentPassword(AgentPasswordRequest agentPasswordRequest)
 {
     return(_partnerServiceRepository.GetAgentPassword(agentPasswordRequest));
 }