Ejemplo n.º 1
0
        public async Task <IConsumersResponse> InitiateSession(ConsumerRequest consumersRequest)
        {
            var url = new Uri("/psp/consumers", UriKind.Relative);

            var requestDto = new ConsumerRequestDto(consumersRequest);

            var consumersResponse = await HttpClient.PostAsJsonAsync <ConsumersResponseDto>(url, requestDto);

            return(new ConsumersResponse(consumersResponse));
        }
Ejemplo n.º 2
0
        public ConsumerRequestDto(ConsumerRequest consumerRequest)
        {
            if (consumerRequest == null)
            {
                return;
            }

            if (consumerRequest.NationalIdentifier != null)
            {
                NationalIdentifier = new NationalIdentifierDto(consumerRequest.NationalIdentifier);
            }

            Email     = consumerRequest.Email?.ToString();
            Language  = consumerRequest.Language?.ToString();
            Msisdn    = consumerRequest.Msisdn?.ToString();
            Operation = consumerRequest.Operation.Value;
            ShippingAddressRestrictedToCountryCodes = new List <string>();
            foreach (var item in consumerRequest.ShippingAddressRestrictedToCountryCodes)
            {
                ShippingAddressRestrictedToCountryCodes.Add(item);
            }
        }