/// <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)); }
/// <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)); }
/// <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)); }
/// <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); }
/// <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)); }
/// <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; }