solidus_avatax_certified 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +6 -12
- data/Gemfile +5 -7
- data/app/models/solidus_avatax_certified/line.rb +4 -3
- data/app/models/solidus_avatax_certified/order_adjuster.rb +12 -0
- data/app/models/spree/calculator/avalara_transaction.rb +5 -2
- data/config/initializers/spree.rb +1 -0
- data/lib/solidus_avatax_certified/version.rb +1 -1
- data/solidus_avatax_certified.gemspec +1 -1
- data/spec/features/checkout_spec.rb +8 -8
- data/spec/models/solidus_avatax_certified/order_adjuster_spec.rb +36 -0
- data/spec/models/spree/calculator/avalara_transaction_spec.rb +4 -5
- data/spec/vcr/Certification/Exempt_sales_should_be_reflected_in_the_test_data_through_use_of_ExemptionNo_or_CustomerUsageType_/does_not_add_additional_tax.yml +39 -174
- data/spec/vcr/Checkout/payment/with_promotion/tax_not_included/has_adjusted_tax_amount_after_promotion_applied.yml +88 -18
- data/spec/vcr/SolidusAvataxCertified_OrderAdjuster/_adjust_/at_after_payment_state/updates_the_adjustments.yml +141 -0
- data/spec/vcr/Spree_Calculator_AvalaraTransaction/_compute/when_computing_a_line_item/when_tax_is_not_included_in_price/when_the_line_item_is_discounted/should_be_equal_to_the_items_pre-tax_total_rate.yml +43 -176
- data/spec/vcr/Spree_Calculator_AvalaraTransaction/_compute/when_computing_a_line_item/when_tax_is_not_included_in_price/when_the_order_is_discounted/should_be_equal_to_the_items_pre-tax_total_rate.yml +43 -107
- data/spec/vcr/Spree_Refund/full_refund/returns_correct_tax_calculations.yml +3 -67
- metadata +10 -5
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 2ba6379569acf61b06167ab217fbb1eca5e472c0
         | 
| 4 | 
            +
              data.tar.gz: b32a50a24a6fad7b76e36f9de281f602a27e7463
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: bc1fd526badf9ece163b015df8368f862094da9f505e107e1ea37e731e914f2780d0b65fad326e59b48631da32c44a35d11935b8ffef3b287c025fbebf30cd8d
         | 
| 7 | 
            +
              data.tar.gz: d638aa46c762ad2b656f785d3df01f1068ef090bf3bbe7d6b213820ce27c162ef538fe8566c1fe2b305e6e0dc0f29fb0b657174cdf52b770e8a0cf35ee9dc228
         | 
    
        data/.travis.yml
    CHANGED
    
    | @@ -14,15 +14,9 @@ script: | |
| 14 14 | 
             
              - bundle exec rspec
         | 
| 15 15 | 
             
            env:
         | 
| 16 16 | 
             
              matrix:
         | 
| 17 | 
            -
                - SOLIDUS_BRANCH= | 
| 18 | 
            -
                - SOLIDUS_BRANCH= | 
| 19 | 
            -
                - SOLIDUS_BRANCH= | 
| 20 | 
            -
                - SOLIDUS_BRANCH= | 
| 21 | 
            -
                - SOLIDUS_BRANCH= | 
| 22 | 
            -
                - SOLIDUS_BRANCH= | 
| 23 | 
            -
                - SOLIDUS_BRANCH=v1.0 DB=mysql
         | 
| 24 | 
            -
                - SOLIDUS_BRANCH=v1.1 DB=mysql
         | 
| 25 | 
            -
                - SOLIDUS_BRANCH=v1.2 DB=mysql
         | 
| 26 | 
            -
                - SOLIDUS_BRANCH=v1.3 DB=mysql
         | 
| 27 | 
            -
                - SOLIDUS_BRANCH=v1.4 DB=mysql
         | 
| 28 | 
            -
                - SOLIDUS_BRANCH=v2.0 DB=mysql
         | 
| 17 | 
            +
                - SOLIDUS_BRANCH=v2.1 DB=postgres
         | 
| 18 | 
            +
                - SOLIDUS_BRANCH=v2.2 DB=postgres
         | 
| 19 | 
            +
                - SOLIDUS_BRANCH=master DB=postgres
         | 
| 20 | 
            +
                - SOLIDUS_BRANCH=v2.1 DB=mysql
         | 
| 21 | 
            +
                - SOLIDUS_BRANCH=v2.2 DB=mysql
         | 
| 22 | 
            +
                - SOLIDUS_BRANCH=master DB=mysql
         | 
    
        data/Gemfile
    CHANGED
    
    | @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            source "https://rubygems.org"
         | 
| 2 2 |  | 
| 3 | 
            -
            branch =  | 
| 3 | 
            +
            branch = 'v2.1'
         | 
| 4 4 | 
             
            gem "solidus", github: "solidusio/solidus", branch: branch
         | 
| 5 5 | 
             
            gem "solidus_auth_devise", github: "solidusio/solidus_auth_devise"
         | 
| 6 6 |  | 
| @@ -8,12 +8,10 @@ group :test, :development do | |
| 8 8 | 
             
              gem "pry"
         | 
| 9 9 | 
             
            end
         | 
| 10 10 |  | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
             | 
| 15 | 
            -
              gem "rails_test_params_backport", group: :test
         | 
| 16 | 
            -
            end
         | 
| 11 | 
            +
            gem "rails-controller-testing", group: :test
         | 
| 12 | 
            +
             | 
| 13 | 
            +
            gem 'pg'
         | 
| 14 | 
            +
            gem 'mysql2'
         | 
| 17 15 |  | 
| 18 16 | 
             
            gem 'pg'
         | 
| 19 17 | 
             
            gem 'mysql2'
         | 
| @@ -1,6 +1,9 @@ | |
| 1 | 
            +
            require 'spree/tax/tax_helpers'
         | 
| 2 | 
            +
             | 
| 1 3 | 
             
            module SolidusAvataxCertified
         | 
| 2 4 | 
             
              class Line
         | 
| 3 5 | 
             
                attr_reader :order, :lines
         | 
| 6 | 
            +
                include Spree::Tax::TaxHelpers
         | 
| 4 7 |  | 
| 5 8 | 
             
                def initialize(order, invoice_type, refund = nil)
         | 
| 6 9 | 
             
                  @order = order
         | 
| @@ -132,9 +135,7 @@ module SolidusAvataxCertified | |
| 132 135 | 
             
                end
         | 
| 133 136 |  | 
| 134 137 | 
             
                def tax_included_in_price?(item)
         | 
| 135 | 
            -
                   | 
| 136 | 
            -
                  # if no tax rates, raise error tax rates needs to be set up
         | 
| 137 | 
            -
                  order.tax_zone.tax_rates.where(tax_category: item.tax_category).try(:first).included_in_price
         | 
| 138 | 
            +
                  rates_for_item(item).try(:first).included_in_price || false
         | 
| 138 139 | 
             
                end
         | 
| 139 140 | 
             
              end
         | 
| 140 141 | 
             
            end
         | 
| @@ -36,11 +36,14 @@ module Spree | |
| 36 36 | 
             
                  end
         | 
| 37 37 | 
             
                end
         | 
| 38 38 |  | 
| 39 | 
            +
                # Tax Adjustments are not created or calculated until on payment page.
         | 
| 40 | 
            +
                # 1. We do not want to calculate tax until address is filled in and shipment type has been selected.
         | 
| 41 | 
            +
                # 2. VAT tax adjustments set included on adjustment creation, if the tax initially returns 0, included is set to false causing incorrect calculations.
         | 
| 39 42 | 
             
                def can_calculate_tax?(order)
         | 
| 40 | 
            -
                  address = order. | 
| 43 | 
            +
                  address = order.tax_address
         | 
| 41 44 |  | 
| 42 45 | 
             
                  return false unless Spree::Avatax::Config.tax_calculation
         | 
| 43 | 
            -
                  return false if %w(address cart).include?(order.state)
         | 
| 46 | 
            +
                  return false if %w(address cart delivery).include?(order.state)
         | 
| 44 47 | 
             
                  return false if address.nil?
         | 
| 45 48 | 
             
                  return false unless calculable.zone.include?(address)
         | 
| 46 49 |  | 
| @@ -1,3 +1,4 @@ | |
| 1 1 | 
             
            Spree.user_class = "Spree::User"
         | 
| 2 2 | 
             
            Spree::PermittedAttributes.user_attributes.concat([:avalara_entity_use_code_id, :exemption_number, :vat_id])
         | 
| 3 3 | 
             
            Rails.application.config.spree.calculators.tax_rates << Spree::Calculator::AvalaraTransaction
         | 
| 4 | 
            +
            Spree::Config.tax_adjuster_class = SolidusAvataxCertified::OrderAdjuster
         | 
| @@ -21,7 +21,7 @@ Gem::Specification.new do |s| | |
| 21 21 | 
             
              s.require_path = "lib"
         | 
| 22 22 | 
             
              s.requirements << "none"
         | 
| 23 23 |  | 
| 24 | 
            -
              s.add_dependency "solidus_core", [">= 1.0 | 
| 24 | 
            +
              s.add_dependency "solidus_core", [">= 2.1.0", "< 2.3.0"]
         | 
| 25 25 | 
             
              s.add_dependency "json", "~> 1.8"
         | 
| 26 26 | 
             
              s.add_dependency "addressable", "~> 2.4"
         | 
| 27 27 | 
             
              s.add_dependency "rest-client", "~> 1.7"
         | 
| @@ -1,8 +1,9 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 | 
            -
            describe "Checkout", :vcr, type: :feature, inaccessible: true do
         | 
| 3 | 
            +
            describe "Checkout", :vcr, type: :feature, inaccessible: true, js: true do
         | 
| 4 4 | 
             
              let(:product) { Spree::Product.first }
         | 
| 5 | 
            -
              let | 
| 5 | 
            +
              let(:included_in_price) { false }
         | 
| 6 | 
            +
              let!(:order) { create(:avalara_order, state: 'cart', shipment_cost: 10, tax_included: included_in_price) }
         | 
| 6 7 | 
             
              let!(:user) { order.user }
         | 
| 7 8 |  | 
| 8 9 | 
             
              before do
         | 
| @@ -58,6 +59,7 @@ describe "Checkout", :vcr, type: :feature, inaccessible: true do | |
| 58 59 | 
             
                end
         | 
| 59 60 |  | 
| 60 61 | 
             
                context 'tax included' do
         | 
| 62 | 
            +
                  let(:included_in_price) { true }
         | 
| 61 63 | 
             
                  before do
         | 
| 62 64 | 
             
                    Spree::TaxRate.update_all(included_in_price: true)
         | 
| 63 65 | 
             
                    order.reload
         | 
| @@ -101,16 +103,14 @@ describe "Checkout", :vcr, type: :feature, inaccessible: true do | |
| 101 103 | 
             
              end
         | 
| 102 104 |  | 
| 103 105 | 
             
              context 'complete order', js: true do
         | 
| 104 | 
            -
                let(:payment_method) { create(: | 
| 105 | 
            -
             | 
| 106 | 
            -
                  create(:credit_card, user_id: order.user.id, payment_method: payment_method, gateway_customer_profile_id: "BGS-WEFWF")
         | 
| 107 | 
            -
                end
         | 
| 106 | 
            +
                let!(:payment_method) { create(:check_payment_method) }
         | 
| 107 | 
            +
             | 
| 108 108 | 
             
                before do
         | 
| 109 109 | 
             
                  allow(order).to receive_messages(:available_payment_methods => [ payment_method ])
         | 
| 110 110 | 
             
                  visit_delivery
         | 
| 111 111 | 
             
                  click_button 'Save and Continue'
         | 
| 112 | 
            -
                  click_button  | 
| 113 | 
            -
                  click_button  | 
| 112 | 
            +
                  click_button 'Save and Continue'
         | 
| 113 | 
            +
                  click_button 'Place Order'
         | 
| 114 114 | 
             
                end
         | 
| 115 115 |  | 
| 116 116 | 
             
                it 'has tax and shipping tax adjustments on page' do
         | 
| @@ -0,0 +1,36 @@ | |
| 1 | 
            +
            require 'spec_helper'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            RSpec.describe SolidusAvataxCertified::OrderAdjuster, :vcr do
         | 
| 4 | 
            +
              subject(:adjuster) { described_class.new(order) }
         | 
| 5 | 
            +
             | 
| 6 | 
            +
              describe '#adjust!' do
         | 
| 7 | 
            +
                context 'before payment state' do
         | 
| 8 | 
            +
                  let(:line_item) { build_stubbed(:line_item) }
         | 
| 9 | 
            +
                  let(:shipment) { build_stubbed(:shipment) }
         | 
| 10 | 
            +
                  let(:order) { build_stubbed(:order, state: 'delivery', line_items: [line_item], shipments: [shipment]) }
         | 
| 11 | 
            +
             | 
| 12 | 
            +
                  it 'does not create new tax adjustments' do
         | 
| 13 | 
            +
                    expect{ adjuster.adjust! }.to_not change { Spree::Adjustment.count }
         | 
| 14 | 
            +
                  end
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                  it 'returns an array of all line items and shipments' do
         | 
| 17 | 
            +
                    expect(adjuster.adjust!).to include(line_item)
         | 
| 18 | 
            +
                    expect(adjuster.adjust!).to include(shipment)
         | 
| 19 | 
            +
                  end
         | 
| 20 | 
            +
                end
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                context 'at & after payment state' do
         | 
| 23 | 
            +
                  let(:order) { create(:avalara_order) }
         | 
| 24 | 
            +
             | 
| 25 | 
            +
                  before do
         | 
| 26 | 
            +
                    order.reload # Allow order to create
         | 
| 27 | 
            +
                    order.line_items.update_all(price: 20)
         | 
| 28 | 
            +
                  end
         | 
| 29 | 
            +
             | 
| 30 | 
            +
                  it 'updates the adjustments' do
         | 
| 31 | 
            +
                    expect(order.state).to eq('payment')
         | 
| 32 | 
            +
                    expect{ adjuster.adjust! }.to change { order.line_items.first.adjustments.tax.first.amount }.from(0.4).to(0.8)
         | 
| 33 | 
            +
                  end
         | 
| 34 | 
            +
                end
         | 
| 35 | 
            +
              end
         | 
| 36 | 
            +
            end
         | 
| @@ -1,6 +1,6 @@ | |
| 1 1 | 
             
            require 'spec_helper'
         | 
| 2 2 |  | 
| 3 | 
            -
            describe Spree::Calculator::AvalaraTransaction do
         | 
| 3 | 
            +
            describe Spree::Calculator::AvalaraTransaction, :vcr do
         | 
| 4 4 | 
             
              let(:included_in_price) { false }
         | 
| 5 5 | 
             
              let(:tax_category) { Spree::TaxCategory.find_or_create_by(name: 'Clothing', tax_code: 'P0000000') }
         | 
| 6 6 | 
             
              let(:calculator) { Spree::TaxRate.find_by(name: 'Tax').calculator }
         | 
| @@ -85,12 +85,11 @@ describe Spree::Calculator::AvalaraTransaction do | |
| 85 85 | 
             
                    end
         | 
| 86 86 |  | 
| 87 87 | 
             
                    context 'when the line item is discounted' do
         | 
| 88 | 
            -
                      let | 
| 88 | 
            +
                      let(:promotion) { create(:promotion, :with_line_item_adjustment, adjustment_rate: 2) }
         | 
| 89 89 |  | 
| 90 90 | 
             
                      before do
         | 
| 91 | 
            -
                        create(:adjustment, order: order, source: promotion.promotion_actions.first, adjustable:  | 
| 92 | 
            -
                         | 
| 93 | 
            -
                        order.reload.update!
         | 
| 91 | 
            +
                        create(:adjustment, order: order, source: promotion.promotion_actions.first, adjustable: order.line_items.first)
         | 
| 92 | 
            +
                        order.update!
         | 
| 94 93 | 
             
                      end
         | 
| 95 94 |  | 
| 96 95 | 
             
                      it 'should be equal to the items pre-tax total * rate' do
         | 
| @@ -5,13 +5,13 @@ http_interactions: | |
| 5 5 | 
             
                uri: https://development.avalara.net/1.0/tax/get
         | 
| 6 6 | 
             
                body:
         | 
| 7 7 | 
             
                  encoding: UTF-8
         | 
| 8 | 
            -
                  string: '{"DocCode":" | 
| 9 | 
            -
                    S Jackson St","Line2":"","City":"Montgomery","Region":"AL","PostalCode":"36104","Country":"US"},{"AddressCode":"Dest","Line1":" | 
| 10 | 
            -
                     | 
| 8 | 
            +
                  string: '{"DocCode":"R607844213","DocDate":"2017-03-24","Discount":"0.0","Commit":false,"DocType":"SalesOrder","Addresses":[{"AddressCode":"Orig","Line1":"915
         | 
| 9 | 
            +
                    S Jackson St","Line2":"","City":"Montgomery","Region":"AL","PostalCode":"36104","Country":"US"},{"AddressCode":"Dest","Line1":"915
         | 
| 10 | 
            +
                    S Jackson St","Line2":"","City":"Montgomery","Region":"Alabama","Country":"US","PostalCode":"36104"},{"AddressCode":"2","Line1":"1600
         | 
| 11 11 | 
             
                    Pennsylvania Ave NW","Line2":null,"City":"Washington","PostalCode":"20500","Country":"US"}],"Lines":[{"LineNo":"1-LI","Description":"Product
         | 
| 12 | 
            -
                    # | 
| 12 | 
            +
                    #1 - 3270","TaxCode":"PC030000","ItemCode":"SKU-1","Qty":1,"Amount":10.0,"OriginCode":"2","DestinationCode":"Dest","CustomerUsageType":null,"Discounted":false,"TaxIncluded":false},{"LineNo":"1-FR","ItemCode":"Avalara
         | 
| 13 13 | 
             
                    Ground","Qty":1,"Amount":5.0,"OriginCode":"2","DestinationCode":"Dest","CustomerUsageType":null,"Description":"Shipping
         | 
| 14 | 
            -
                    Charge","TaxCode":"FR000000","Discounted":false,"TaxIncluded":false}],"CustomerCode":1,"CompanyCode":"54321","CustomerUsageType":null,"ExemptionNo":null,"Client":"a0o33000004FH8l","ReferenceCode":" | 
| 14 | 
            +
                    Charge","TaxCode":"FR000000","Discounted":false,"TaxIncluded":false}],"CustomerCode":1,"CompanyCode":"54321","CustomerUsageType":null,"ExemptionNo":null,"Client":"a0o33000004FH8l","ReferenceCode":"R607844213","DetailLevel":"Tax","CurrencyCode":"USD"}'
         | 
| 15 15 | 
             
                headers:
         | 
| 16 16 | 
             
                  Accept:
         | 
| 17 17 | 
             
                  - "*/*; q=0.5, application/xml"
         | 
| @@ -43,146 +43,11 @@ http_interactions: | |
| 43 43 | 
             
                  X-Powered-By:
         | 
| 44 44 | 
             
                  - ASP.NET
         | 
| 45 45 | 
             
                  Date:
         | 
| 46 | 
            -
                  -  | 
| 46 | 
            +
                  - Fri, 24 Mar 2017 15:27:41 GMT
         | 
| 47 47 | 
             
                  Content-Length:
         | 
| 48 48 | 
             
                  - '663'
         | 
| 49 49 | 
             
                  Set-Cookie:
         | 
| 50 | 
            -
                  - TS017f1821= | 
| 51 | 
            -
                    Path=/
         | 
| 52 | 
            -
                body:
         | 
| 53 | 
            -
                  encoding: ASCII-8BIT
         | 
| 54 | 
            -
                  string: !binary |-
         | 
| 55 | 
            -
                    H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
         | 
| 56 | 
            -
                    kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
         | 
| 57 | 
            -
                    AWz2zkrayZ4hgKrIHz9+fB8/In5x8tGb7N3zYpk3Hz1Kv5fQ3/jjRUV/fbS7
         | 
| 58 | 
            -
                    /fzsoxG3OKlmOT56ebJzb4ce/TibFGXRXuObtl7n+PRJtV7Osvr6eX6Zl/ji
         | 
| 59 | 
            -
                    p4rVfXxx+i5frNqiWuJDBvC0aKbUurUfMMSSO9rlD15lLf+1M97Zp175M2ok
         | 
| 60 | 
            -
                    H+3rXydZOV2X1HIWfv40b7OitOM6QVc14/rVazR5lV8oNsfP8fd31nXRvLle
         | 
| 61 | 
            -
                    cY+vWwJoPzXD39nFRwT7fdFkKC+yBTc7fn785PiLY3xOrdyn6es3x29O0zfH
         | 
| 62 | 
            -
                    v/dHvyT5fvJLkhGh7U/Hs1f6jsHn2SvqjR79+GdvOviVjcPc07+6s2E+/2HM
         | 
| 63 | 
            -
                    xi2xZCCO7LecjO8n0uR4NqvzpnECox8YrJ7mTQtovRG+rJo2K02ze5/u7jBr
         | 
| 64 | 
            -
                    dAdOXchHZ0zBvZ37ew8ePsQ3jLd5f2d3d2f3/q4OUHHAF8fp0+L8PK/zZZu+
         | 
| 65 | 
            -
                    qrIZvj5RrviiWrYX1SIntIS79D0DlMlzA+KEkPQpWOKjpyf4u4M4twlQJoz1
         | 
| 66 | 
            -
                    wVfaNX/x6c5O+jJfLpvr8jJbFll6fJmnL76LZgb172bNvFhetNSjm4unOtd7
         | 
| 67 | 
            -
                    O7sPtnfube8xRzytpqbLV/sPDu7v7j/YfaBfxN94Uyxo1rLFKvzqzd7uo3v3
         | 
| 68 | 
            -
                    Hu0/GD8kGA/2P/0pblwRNY4XoBKa7zLX8Yd9CcKnfUnjjwl9w7ceCPoUn+yM
         | 
| 69 | 
            -
                    P/U/6goVf/kqb9Zla0b6ej2dgpy/JPl/AL0wL/3UBQAA
         | 
| 70 | 
            -
                http_version: 
         | 
| 71 | 
            -
              recorded_at: Tue, 21 Mar 2017 21:33:46 GMT
         | 
| 72 | 
            -
            - request:
         | 
| 73 | 
            -
                method: post
         | 
| 74 | 
            -
                uri: https://development.avalara.net/1.0/tax/get
         | 
| 75 | 
            -
                body:
         | 
| 76 | 
            -
                  encoding: UTF-8
         | 
| 77 | 
            -
                  string: '{"DocCode":"R105275816","DocDate":"2017-03-21","Discount":"0.0","Commit":false,"DocType":"SalesOrder","Addresses":[{"AddressCode":"Orig","Line1":"915
         | 
| 78 | 
            -
                    S Jackson St","Line2":"","City":"Montgomery","Region":"AL","PostalCode":"36104","Country":"US"},{"AddressCode":"Dest","Line1":"3366
         | 
| 79 | 
            -
                    Speedway Blvd","Line2":"","City":"Lincoln","Region":"Alabama","Country":"US","PostalCode":"35096"},{"AddressCode":"3","Line1":"1600
         | 
| 80 | 
            -
                    Pennsylvania Ave NW","Line2":null,"City":"Washington","PostalCode":"20500","Country":"US"}],"Lines":[{"LineNo":"2-LI","Description":"Product
         | 
| 81 | 
            -
                    #9 - 9966","TaxCode":"PC030000","ItemCode":"SKU-9","Qty":1,"Amount":10.0,"OriginCode":"3","DestinationCode":"Dest","CustomerUsageType":"","Discounted":false,"TaxIncluded":false}],"CustomerCode":"acreilly3@gmail.com","CompanyCode":"54321","CustomerUsageType":"","ExemptionNo":null,"Client":"a0o33000004FH8l","ReferenceCode":"R105275816","DetailLevel":"Tax","CurrencyCode":"USD"}'
         | 
| 82 | 
            -
                headers:
         | 
| 83 | 
            -
                  Accept:
         | 
| 84 | 
            -
                  - "*/*; q=0.5, application/xml"
         | 
| 85 | 
            -
                  Accept-Encoding:
         | 
| 86 | 
            -
                  - gzip, deflate
         | 
| 87 | 
            -
                  Authorization:
         | 
| 88 | 
            -
                  - Basic MTEwMDExMzA5NjoxRDEzRURBMkRDQ0M3RTRB
         | 
| 89 | 
            -
                  Content-Type:
         | 
| 90 | 
            -
                  - application/json
         | 
| 91 | 
            -
                  Content-Length:
         | 
| 92 | 
            -
                  - '932'
         | 
| 93 | 
            -
                  User-Agent:
         | 
| 94 | 
            -
                  - Ruby
         | 
| 95 | 
            -
              response:
         | 
| 96 | 
            -
                status:
         | 
| 97 | 
            -
                  code: 200
         | 
| 98 | 
            -
                  message: OK
         | 
| 99 | 
            -
                headers:
         | 
| 100 | 
            -
                  Cache-Control:
         | 
| 101 | 
            -
                  - private
         | 
| 102 | 
            -
                  Content-Type:
         | 
| 103 | 
            -
                  - text/json; charset=utf-8
         | 
| 104 | 
            -
                  Content-Encoding:
         | 
| 105 | 
            -
                  - gzip
         | 
| 106 | 
            -
                  Vary:
         | 
| 107 | 
            -
                  - Accept-Encoding
         | 
| 108 | 
            -
                  X-Aspnet-Version:
         | 
| 109 | 
            -
                  - 4.0.30319
         | 
| 110 | 
            -
                  X-Powered-By:
         | 
| 111 | 
            -
                  - ASP.NET
         | 
| 112 | 
            -
                  Date:
         | 
| 113 | 
            -
                  - Tue, 21 Mar 2017 21:33:48 GMT
         | 
| 114 | 
            -
                  Content-Length:
         | 
| 115 | 
            -
                  - '621'
         | 
| 116 | 
            -
                  Set-Cookie:
         | 
| 117 | 
            -
                  - TS017f1821=01a8ddc44ed87dfee437a076fa854f1263c59ca6d001c58df077d5b84b3c3ea2771fa897dd1b42769a77cf32d59f807922bce36b86;
         | 
| 118 | 
            -
                    Path=/
         | 
| 119 | 
            -
                body:
         | 
| 120 | 
            -
                  encoding: ASCII-8BIT
         | 
| 121 | 
            -
                  string: !binary |-
         | 
| 122 | 
            -
                    H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
         | 
| 123 | 
            -
                    kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
         | 
| 124 | 
            -
                    AWz2zkrayZ4hgKrIHz9+fB8/In5x8tGrvFmX7Uk1yz96lH70ej2d5k3z0Sj5
         | 
| 125 | 
            -
                    6Gk1fZq1/Onezu6D7Z1723u7+OJNscibNluswq/e7O0+unfv0f7B+NODg4f7
         | 
| 126 | 
            -
                    B/s/xY2rNiuPF9V62aL57o798GnRTM3H7tPTd/li1RbVMvz4TfYum5SMjAeC
         | 
| 127 | 
            -
                    PsUnO+N9/6OTrJyuS0J95n+ZvYuPhoZpBv9qd+f+3oP7B7uf4gt643mxzBv6
         | 
| 128 | 
            -
                    5nsJEQp/vKjor4/2tp+faQvz6suTnXs79OjH2aQoi/Ya37T1OsenT2iss6y+
         | 
| 129 | 
            -
                    fp5f5iW++KlidR9f9Efcpwwg+qN/pUPZGe/sU6/8GTWSj8x4B+mQt1lR2nGd
         | 
| 130 | 
            -
                    oKuacf3qNZq8yi8Um+Pn+Ps767po3lyvuMfXLQG0n5rh7zApCfb7oslQXmQL
         | 
| 131 | 
            -
                    bnb8/PjJ8RfH+JxauU/T12+O35ymb45/749+SfL9BP+XJsezWU3c6uZIP6A/
         | 
| 132 | 
            -
                    P7p379NP09erPJ9dZdfpk/JyBrjawOD9lBgZH5/oZNEcT6tyyR91yfKyIqYv
         | 
| 133 | 
            -
                    zZv37u88ZDbpUovQko/OmOx7u3v7Dz/dwzc8VvP+zu7u3u7+vd29HRrTKER9
         | 
| 134 | 
            -
                    99OdnfRlvlw21+Vltiyy9PgyT198F0C0mQFzD58Z7L+bNfNiedESOvh08wD2
         | 
| 135 | 
            -
                    du7LhAi2+OjpCf7uDIDbBKjv7tJU8kOoYzr+H6NlJhVGBAAA
         | 
| 136 | 
            -
                http_version: 
         | 
| 137 | 
            -
              recorded_at: Tue, 21 Mar 2017 21:33:47 GMT
         | 
| 138 | 
            -
            - request:
         | 
| 139 | 
            -
                method: post
         | 
| 140 | 
            -
                uri: https://development.avalara.net/1.0/tax/get
         | 
| 141 | 
            -
                body:
         | 
| 142 | 
            -
                  encoding: UTF-8
         | 
| 143 | 
            -
                  string: '{"DocCode":"R478514717","DocDate":"2017-03-21","Discount":"0.0","Commit":false,"DocType":"SalesInvoice","Addresses":[{"AddressCode":"Orig","Line1":"915
         | 
| 144 | 
            -
                    S Jackson St","Line2":"","City":"Montgomery","Region":"AL","PostalCode":"36104","Country":"US"},{"AddressCode":"Dest","Line1":"A
         | 
| 145 | 
            -
                    Different Road","Line2":"","City":"Montgomery","Region":"Alabama","Country":"US","PostalCode":"36104"},{"AddressCode":"2","Line1":"1600
         | 
| 146 | 
            -
                    Pennsylvania Ave NW","Line2":null,"City":"Washington","PostalCode":"20500","Country":"US"}],"Lines":[{"LineNo":"1-LI","Description":"Product
         | 
| 147 | 
            -
                    #8 - 9986","TaxCode":"PC030000","ItemCode":"SKU-8","Qty":1,"Amount":10.0,"OriginCode":"2","DestinationCode":"Dest","CustomerUsageType":"A","Discounted":false,"TaxIncluded":false},{"LineNo":"1-FR","ItemCode":"Avalara
         | 
| 148 | 
            -
                    Ground","Qty":1,"Amount":5.0,"OriginCode":"2","DestinationCode":"Dest","CustomerUsageType":"A","Description":"Shipping
         | 
| 149 | 
            -
                    Charge","TaxCode":"FR000000","Discounted":false,"TaxIncluded":false}],"CustomerCode":1,"CompanyCode":"54321","CustomerUsageType":"A","ExemptionNo":null,"Client":"a0o33000004FH8l","ReferenceCode":"R478514717","DetailLevel":"Tax","CurrencyCode":"USD"}'
         | 
| 150 | 
            -
                headers:
         | 
| 151 | 
            -
                  Accept:
         | 
| 152 | 
            -
                  - "*/*; q=0.5, application/xml"
         | 
| 153 | 
            -
                  Accept-Encoding:
         | 
| 154 | 
            -
                  - gzip, deflate
         | 
| 155 | 
            -
                  Authorization:
         | 
| 156 | 
            -
                  - Basic MTEwMDExMzA5NjoxRDEzRURBMkRDQ0M3RTRB
         | 
| 157 | 
            -
                  Content-Type:
         | 
| 158 | 
            -
                  - application/json
         | 
| 159 | 
            -
                  Content-Length:
         | 
| 160 | 
            -
                  - '1142'
         | 
| 161 | 
            -
                  User-Agent:
         | 
| 162 | 
            -
                  - Ruby
         | 
| 163 | 
            -
              response:
         | 
| 164 | 
            -
                status:
         | 
| 165 | 
            -
                  code: 200
         | 
| 166 | 
            -
                  message: OK
         | 
| 167 | 
            -
                headers:
         | 
| 168 | 
            -
                  Cache-Control:
         | 
| 169 | 
            -
                  - private
         | 
| 170 | 
            -
                  Content-Type:
         | 
| 171 | 
            -
                  - text/json; charset=utf-8
         | 
| 172 | 
            -
                  Content-Encoding:
         | 
| 173 | 
            -
                  - gzip
         | 
| 174 | 
            -
                  Vary:
         | 
| 175 | 
            -
                  - Accept-Encoding
         | 
| 176 | 
            -
                  X-Aspnet-Version:
         | 
| 177 | 
            -
                  - 4.0.30319
         | 
| 178 | 
            -
                  X-Powered-By:
         | 
| 179 | 
            -
                  - ASP.NET
         | 
| 180 | 
            -
                  Date:
         | 
| 181 | 
            -
                  - Tue, 21 Mar 2017 21:33:48 GMT
         | 
| 182 | 
            -
                  Content-Length:
         | 
| 183 | 
            -
                  - '644'
         | 
| 184 | 
            -
                  Set-Cookie:
         | 
| 185 | 
            -
                  - TS017f1821=01a8ddc44e1b31152ba7b97a040ef2b39165e207569414b590c7bd8d5f53e86f6fc9430579995125913cd7a2b0900daee9a11e5e0e;
         | 
| 50 | 
            +
                  - TS017f1821=01a8ddc44e0b8a4408655952a95767026b3979db519efd3531b708098d76ad0011e44884c4ca1a757089ed24f77478698044d18a08;
         | 
| 186 51 | 
             
                    Path=/
         | 
| 187 52 | 
             
                body:
         | 
| 188 53 | 
             
                  encoding: ASCII-8BIT
         | 
| @@ -190,32 +55,32 @@ http_interactions: | |
| 190 55 | 
             
                    H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
         | 
| 191 56 | 
             
                    kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
         | 
| 192 57 | 
             
                    AWz2zkrayZ4hgKrIHz9+fB8/In5x8tGrvFmX7Uk1yz96lH70ej2d5k3z0Sj5
         | 
| 193 | 
            -
                     | 
| 194 | 
            -
                     | 
| 195 | 
            -
                     | 
| 196 | 
            -
                     | 
| 197 | 
            -
                     | 
| 198 | 
            -
                     | 
| 199 | 
            -
                     | 
| 200 | 
            -
                     | 
| 201 | 
            -
                     | 
| 202 | 
            -
                     | 
| 203 | 
            -
                     | 
| 204 | 
            -
                     | 
| 58 | 
            +
                    6Gk1NZ+++nTnwcH+/t7uPf3iadbyF3s7uw+2d+5t7+3jizfFIm/abLEKv3qz
         | 
| 59 | 
            +
                    e//R3oNH+7vjg3v37+1/uv9T3Lhqs/J4Ua2XLZrv3rcfPi2aqfl4x356+i5f
         | 
| 60 | 
            +
                    rNqiWoYfv8neZZOSkfFA0Kf4ZGf8qf/RSVZO1yWhPvO/zN49L5Z5Qx99LyF6
         | 
| 61 | 
            +
                    4I8XFf310e728zNtYQjx8mTn3g49+nE2KcqivcY3bb3O8ekTwnyW1dfP88u8
         | 
| 62 | 
            +
                    xBfHs1mtFO0PoT9UANXh8AevCF38tTPe2aeO+TNqJB8J1Qm9zsDM50/zNitK
         | 
| 63 | 
            +
                    O7QTdFUzul+9RpNX+YVic/wcf39nXRfNm+sV9/i6JYD2U0OBnV18RLDfF02G
         | 
| 64 | 
            +
                    8iJbcLPj58dPjr84xufUyn2avn5z/OY0fXP8e3/0S5LvJ78kGRHa/ow8e6Xv
         | 
| 65 | 
            +
                    GHyevaLe6NGPf1ZnhPlr40j39K/uhJjPfxgTckssGYij/C3n4/uJNFEaOrHR
         | 
| 66 | 
            +
                    DwxWT0kRAFpvhC8r0hClaXbv090d5o7uwKkL+eiMKbi3c3/vwcOH+IbxNu/v
         | 
| 67 | 
            +
                    7O7u7N7f1QEqDvji4e799HX6nWz6tqmW6WvBRRnji2rZXlSLnNASBtP3DFAm
         | 
| 68 | 
            +
                    zw2IE0LSp2CJj56e4O8O4twmQJkw1gdfadf8xac7O+nLfLlsrsvLbFlk6fFl
         | 
| 69 | 
            +
                    nr74LpoZ1L+bNfNiedFSj24uIsr4lyT/D9wIMU7aBQAA
         | 
| 205 70 | 
             
                http_version: 
         | 
| 206 | 
            -
              recorded_at:  | 
| 71 | 
            +
              recorded_at: Fri, 24 Mar 2017 15:27:41 GMT
         | 
| 207 72 | 
             
            - request:
         | 
| 208 73 | 
             
                method: post
         | 
| 209 74 | 
             
                uri: https://development.avalara.net/1.0/tax/get
         | 
| 210 75 | 
             
                body:
         | 
| 211 76 | 
             
                  encoding: UTF-8
         | 
| 212 | 
            -
                  string: '{"DocCode":" | 
| 77 | 
            +
                  string: '{"DocCode":"R607844213","DocDate":"2017-03-24","Discount":"0.0","Commit":false,"DocType":"SalesInvoice","Addresses":[{"AddressCode":"Orig","Line1":"915
         | 
| 213 78 | 
             
                    S Jackson St","Line2":"","City":"Montgomery","Region":"AL","PostalCode":"36104","Country":"US"},{"AddressCode":"Dest","Line1":"915
         | 
| 214 79 | 
             
                    S Jackson St","Line2":"","City":"Montgomery","Region":"Alabama","Country":"US","PostalCode":"36104"},{"AddressCode":"2","Line1":"1600
         | 
| 215 80 | 
             
                    Pennsylvania Ave NW","Line2":null,"City":"Washington","PostalCode":"20500","Country":"US"}],"Lines":[{"LineNo":"1-LI","Description":"Product
         | 
| 216 | 
            -
                    # | 
| 81 | 
            +
                    #1 - 3270","TaxCode":"PC030000","ItemCode":"SKU-1","Qty":1,"Amount":10.0,"OriginCode":"2","DestinationCode":"Dest","CustomerUsageType":"A","Discounted":false,"TaxIncluded":false},{"LineNo":"1-FR","ItemCode":"Avalara
         | 
| 217 82 | 
             
                    Ground","Qty":1,"Amount":5.0,"OriginCode":"2","DestinationCode":"Dest","CustomerUsageType":"A","Description":"Shipping
         | 
| 218 | 
            -
                    Charge","TaxCode":"FR000000","Discounted":false,"TaxIncluded":false}],"CustomerCode":1,"CompanyCode":"54321","CustomerUsageType":"A","ExemptionNo":null,"Client":"a0o33000004FH8l","ReferenceCode":" | 
| 83 | 
            +
                    Charge","TaxCode":"FR000000","Discounted":false,"TaxIncluded":false}],"CustomerCode":1,"CompanyCode":"54321","CustomerUsageType":"A","ExemptionNo":null,"Client":"a0o33000004FH8l","ReferenceCode":"R607844213","DetailLevel":"Tax","CurrencyCode":"USD"}'
         | 
| 219 84 | 
             
                headers:
         | 
| 220 85 | 
             
                  Accept:
         | 
| 221 86 | 
             
                  - "*/*; q=0.5, application/xml"
         | 
| @@ -247,11 +112,11 @@ http_interactions: | |
| 247 112 | 
             
                  X-Powered-By:
         | 
| 248 113 | 
             
                  - ASP.NET
         | 
| 249 114 | 
             
                  Date:
         | 
| 250 | 
            -
                  -  | 
| 115 | 
            +
                  - Fri, 24 Mar 2017 15:27:41 GMT
         | 
| 251 116 | 
             
                  Content-Length:
         | 
| 252 | 
            -
                  - ' | 
| 117 | 
            +
                  - '644'
         | 
| 253 118 | 
             
                  Set-Cookie:
         | 
| 254 | 
            -
                  - TS017f1821= | 
| 119 | 
            +
                  - TS017f1821=01a8ddc44e88d767c51c757cebeb3ba2637e6bc378db027472f390ef1b8557783e9b22c812361beab41629fc440b99ec9fb3d5744c;
         | 
| 255 120 | 
             
                    Path=/
         | 
| 256 121 | 
             
                body:
         | 
| 257 122 | 
             
                  encoding: ASCII-8BIT
         | 
| @@ -259,18 +124,18 @@ http_interactions: | |
| 259 124 | 
             
                    H4sIAAAAAAAEAO29B2AcSZYlJi9tynt/SvVK1+B0oQiAYBMk2JBAEOzBiM3m
         | 
| 260 125 | 
             
                    kuwdaUcjKasqgcplVmVdZhZAzO2dvPfee++999577733ujudTif33/8/XGZk
         | 
| 261 126 | 
             
                    AWz2zkrayZ4hgKrIHz9+fB8/In5x8tGrvFmX7Uk1yz96lH70ej2d5k3z0Sj5
         | 
| 262 | 
            -
                    6Gk1NZ | 
| 263 | 
            -
                     | 
| 264 | 
            -
                     | 
| 265 | 
            -
                     | 
| 266 | 
            -
                     | 
| 267 | 
            -
                     | 
| 268 | 
            -
                     | 
| 269 | 
            -
                     | 
| 270 | 
            -
                     | 
| 271 | 
            -
                     | 
| 272 | 
            -
                     | 
| 273 | 
            -
                     | 
| 127 | 
            +
                    6Gk1NZ+++nTnwcH+/t7uPf3iadbyF3s7uw+2d+5t7+3jizfFIm/abLEKv3qz
         | 
| 128 | 
            +
                    e//R3oNH+3vjT3cYwJuqzcrjRbVetmi5e99++LRopubjHfvp6bt8sWqLaomP
         | 
| 129 | 
            +
                    vdZvsnfZpGREXGP6sPfBSVZO1yXhPHNfZe+eF8u8oQ++lxAZ8MeLiv76aHf7
         | 
| 130 | 
            +
                    +Zm2MON/ebJzb4ce/TibFGXRXuObtl7n+PQJYT3L6uvn+WVe4ovj2axWQobo
         | 
| 131 | 
            +
                    M5D+OAHVG8orQpb/GO/sU8f8GbXhj/T3+KCe5m1WlHZYJ+ilZlS/eo0mr/IL
         | 
| 132 | 
            +
                    xeT4Of7+zroumjfXK+7tdUvg7Kdm9Du7+IhgvxeGDOJFtuBGx8+Pnxx/cYzP
         | 
| 133 | 
            +
                    qY37NH395vjNafrm+Pf+6Jck309+STIinP2pePZK3zHIPHtFfdGjH3/IVDAj
         | 
| 134 | 
            +
                    /Wgm5NPeTHw/kSZKPScp+gH9+dHD3fvp6/Q72fRtUy3T1y2g6tcG5aekEfDx
         | 
| 135 | 
            +
                    ic7SF9WyvagWOVECn3aJ8rIiBVKal+99urvDmqVLK8JLPjpjku/t3N978PAh
         | 
| 136 | 
            +
                    vuHBmvd3dnd3du/vgibCWoocvtv9dGcnfZkvl811eZktiyw9vszTF98FEG1m
         | 
| 137 | 
            +
                    wOzhMzOA72bNvFhetIQOPt08AEKM+qaPBVt89PQEf3cGwG0C1AlzfQh1MxcR
         | 
| 138 | 
            +
                    tftLkv8HUXts98QFAAA=
         | 
| 274 139 | 
             
                http_version: 
         | 
| 275 | 
            -
              recorded_at:  | 
| 140 | 
            +
              recorded_at: Fri, 24 Mar 2017 15:27:42 GMT
         | 
| 276 141 | 
             
            recorded_with: VCR 3.0.3
         |