示例#1
0
        public override async Task <KycDocumentsResponse> GetKycDocuments(Empty request, ServerCallContext context)
        {
            var result = new KycDocumentsResponse();

            var token    = context.GetBearerToken();
            var response = await _walletApiV1Client.GetKycProfilesDocumentsByProfileTypeAsync("LykkeEurope", token);

            if (response.Result != null)
            {
                foreach (var item in response.Result)
                {
                    var document = _mapper.Map <KycDocument>(item.Value);
                    if (item.Value.Files.Any())
                    {
                        document.Files.AddRange(_mapper.Map <List <KycFile> >(item.Value.Files));
                    }

                    result.Body = new KycDocumentsResponse.Types.Body();
                    result.Body.Result.Add(item.Key, document);
                }
            }

            if (response.Error != null)
            {
                result.Error = response.Error.ToApiError();
            }

            return(result);
        }
示例#2
0
        public override Task <KycDocumentsResponse> GetKycDocuments(Empty request, ServerCallContext context)
        {
            var resp = new KycDocumentsResponse()
            {
                Result = { }
            };

            return(Task.FromResult(resp));
        }