/// <summary>
        /// Looks up member id for a given alias.
        /// </summary>
        /// <param name="alias">the alias to check</param>
        /// <returns>member id if alias already exists, null otherwise</returns>
        public Task <string> GetMemberId(Alias alias)
        {
            var request = new ResolveAliasRequest {
                Alias = alias
            };

            return(gateway.ResolveAliasAsync(request)
                   .ToTask(response => response.Member?.Id));
        }
        /// <summary>
        /// Resolve an alias to a TokenMember object, containing member ID and
        /// the alias with the correct type.
        /// </summary>
        /// <param name="alias">alias to resolve</param>
        /// <returns>TokenMember</returns>
        public Task <TokenMember> ResolveAlias(Alias alias)
        {
            var request = new ResolveAliasRequest {
                Alias = alias
            };

            return(gateway.ResolveAliasAsync(request)
                   .ToTask(response => response.Member));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Looks up member id for a given alias.
        /// </summary>
        /// <param name="alias">the alias to check</param>
        /// <returns>member id if alias already exists, null otherwise</returns>
        public Task <string> GetMemberId(Alias alias)
        {
            var request = new ResolveAliasRequest {
                Alias = alias
            };

            return(gateway.ResolveAliasAsync(request)
                   .ToTask(response => response.Member != null ?
                           response.Member.Id : throw new MemberNotFoundException(alias)));
        }
Ejemplo n.º 4
0
        public async Task <ResolveAliasResponse> ResolveVisaAliasAsync(ResolveAliasRequest request)
        {
            ResolveVisaAliasRequest content = _mapper.Map <ResolveAliasRequest, ResolveVisaAliasRequest>(request);
            Stream responseStream           = await _httpRequestSender.SendPostRequest(_VisaAliasOptions.ResolveApi, content);

            ResolveVisaAliasResponse response = await _cryptographyHelper.DecryptResponse <ResolveVisaAliasResponse>(responseStream);

            ResolveAliasResponse resolveAliasResponse = _mapper.Map <ResolveVisaAliasResponse, ResolveAliasResponse>(response);

            return(resolveAliasResponse);
        }
 public void ResolveAliasAsync(ResolveAliasRequest request, AmazonServiceCallback <ResolveAliasRequest, ResolveAliasResponse> callback, AsyncOptions options = null)
 {
     throw new System.NotImplementedException();
 }
Ejemplo n.º 6
0
        public async Task <IActionResult> ResolveVisaAliasAsync([FromBody] ResolveAliasRequest request)
        {
            ResolveAliasResponse response = await _AcbaVisaAliasService.ResolveVisaAliasAsync(request);

            return(Ok(response));
        }