/// <summary>
        /// Gets a list of all Addresses bound to a Customer account
        /// </summary>
        /// <getCustomerByIdParam name="customerId">The customer's unique identifier</getCustomerByIdParam>
        /// <getCustomerByIdParam name="scopeId">The scope to which those address belong</getCustomerByIdParam>
        /// <returns>
        /// A list of all Addresses bound to a Customer account
        /// </returns>
        public virtual Task <List <Address> > GetCustomerAddressesAsync(Guid customerId, string scopeId)
        {
            if (customerId == Guid.Empty)
            {
                throw new ArgumentException(ArgumentNullMessageFormatter.FormatErrorMessage("customerId"));
            }
            if (scopeId == null)
            {
                throw new ArgumentNullException("scopeId");
            }

            var getCustomerAddressesRequest = new GetCustomerAddressesRequest {
                CustomerId = customerId, ScopeId = scopeId
            };

            return(OvertureClient.SendAsync(getCustomerAddressesRequest));
        }
예제 #2
0
        /// <summary>
        /// Gets a list of all Addresses bound to a Customer account
        /// </summary>
        /// <getCustomerByIdParam name="customerId">The customer's unique identifier</getCustomerByIdParam>
        /// <getCustomerByIdParam name="scopeId">The scope to which those address belong</getCustomerByIdParam>
        /// <returns>
        /// A list of all Addresses bound to a Customer account
        /// </returns>
        public virtual Task <List <Address> > GetCustomerAddressesAsync(Guid customerId, string scopeId)
        {
            if (customerId == Guid.Empty)
            {
                throw new ArgumentException(GetMessageOfEmpty(), nameof(customerId));
            }
            if (scopeId == null)
            {
                throw new ArgumentNullException(nameof(scopeId));
            }

            var getCustomerAddressesRequest = new GetCustomerAddressesRequest {
                CustomerId = customerId, ScopeId = scopeId
            };

            return(OvertureClient.SendAsync(getCustomerAddressesRequest));
        }
예제 #3
0
        /// <summary>
        /// doRequest
        /// </summary>
        /// <returns>GetCustomerAddressesResponse</returns>
        public async Task <GetCustomerAddressesResponse> DoRequestAsync()
        {
            GetCustomerAddressesRequest request = PrepareRequest();

            Soapsc = new ServiceSoapClient(new BasicHttpBinding
            {
                Name = "ServiceSoap",
                //Security = new BasicHttpSecurity
                //{
                //    Mode = BasicHttpSecurityMode.Transport
                //}
            },
                                           new EndpointAddress(
                                               _config.GetEndPoint(_orderType == "Invoice"
                                                                       ? PaymentType.INVOICE
                                                                       : PaymentType.PAYMENTPLAN)));

            return(await Soapsc.GetAddressesAsync(request));
        }
예제 #4
0
        /// <summary>
        /// prepareRequest
        /// </summary>
        /// <exception cref="SveaWebPayValidationException"></exception>
        /// <returns>SveaRequest</returns>
        public GetCustomerAddressesRequest PrepareRequest()
        {
            string errors = ValidateRequest();

            if (errors.Length > 0)
            {
                throw new SveaWebPayValidationException(errors);
            }

            var request = new GetCustomerAddressesRequest
            {
                Auth           = GetStoreAuthorization(),
                CountryCode    = _countryCode.ToString().ToUpper(),
                IsCompany      = _companyId != null,
                SecurityNumber = _companyId ?? _nationalNumber
            };

            return(request);
        }
예제 #5
0
        /// <summary>
        /// doRequest
        /// </summary>
        /// <returns>GetCustomerAddressesResponse</returns>
        public GetCustomerAddressesResponse DoRequest()
        {
            GetCustomerAddressesRequest request = PrepareRequest();

            Soapsc = new ServiceSoapClient(new BasicHttpBinding
            {
                Name     = "ServiceSoap",
                Security = new BasicHttpSecurity
                {
                    Mode = BasicHttpSecurityMode.Transport
                }
            },
                                           new EndpointAddress(
                                               _config.GetEndPoint(_orderType == "Invoice"
                                                                       ? PaymentType.INVOICE
                                                                       : PaymentType.PAYMENTPLAN)));

            return(Soapsc.GetAddresses(request));
        }
예제 #6
0
        /// <summary>
        /// prepareRequest
        /// </summary>
        /// <exception cref="SveaWebPayValidationException"></exception>
        /// <returns>SveaRequest</returns>
        public GetCustomerAddressesRequest PrepareRequest()
        {
            string errors = ValidateRequest();
            if (errors.Length > 0)
            {
                throw new SveaWebPayValidationException(errors);
            }

            var request = new GetCustomerAddressesRequest
            {
                Auth = GetStoreAuthorization(),
                CountryCode = _countryCode.ToString().ToUpper(),
                IsCompany = _companyId != null,
                SecurityNumber = _companyId ?? _nationalNumber
            };
            return request;
        }