コード例 #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));
 }