Example #1
0
        public async Task <ListPage <TaxCode> > ListTaxCodesAsync(ListArgs <TaxCode> hsListArgs)
        {
            var args        = TaxCodeMapper.Map(hsListArgs);
            var avataxCodes = await _avaTax.ListTaxCodesAsync(args.Filter, args.Top, args.Skip, args.OrderBy);

            var codeList = TaxCodeMapper.Map(avataxCodes, args);

            return(codeList);
        }
Example #2
0
        public async Task <ListPage <TaxCode> > ListTaxCodesAsync(ListArgs <TaxCode> hsListArgs)
        {
            if (ShouldMockAvalaraResponse())
            {
                return(CreateMockTaxCodeList());
            }

            var args        = TaxCodeMapper.Map(hsListArgs);
            var avataxCodes = await _avaTax.ListTaxCodesAsync(args.Filter, args.Top, args.Skip, args.OrderBy);

            var codeList = TaxCodeMapper.Map(avataxCodes, args);

            return(codeList);
        }
Example #3
0
        public async Task <TaxCategorizationResponse> ListTaxCodesAsync(string searchTerm)
        {
            if (ShouldMockAvalaraResponse())
            {
                return(CreateMockTaxCategorizationResponseModel());
            }

            var search      = TaxCodeMapper.MapSearchString(searchTerm);
            var avataxCodes = await _avaTax.ListTaxCodesAsync(search, null, null, null);

            var codeList = TaxCodeMapper.MapTaxCodes(avataxCodes);

            return(new TaxCategorizationResponse()
            {
                Categories = codeList, ProductsShouldHaveTaxCodes = true
            });
        }