summaryrefslogtreecommitdiff
path: root/spec/super_good
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2019-05-13 20:10:05 -0700
committerJared Norman <jared@super.gd>2019-05-13 20:10:05 -0700
commit1015448f7dc6efa85a4b65c5417dfc870571ea73 (patch)
treea81923e77cfdf6ac005f140a6356b256475edb5b /spec/super_good
parenteaf4f8186610b2b1042630040f5fe96e38d8252f (diff)
Send customer_id to TaxJar API
This is required to support per-customer exemptions through the TaxJar API.
Diffstat (limited to 'spec/super_good')
-rw-r--r--spec/super_good/solidus_taxjar/api_params_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/super_good/solidus_taxjar/api_params_spec.rb b/spec/super_good/solidus_taxjar/api_params_spec.rb
index 0311ab4..9718b88 100644
--- a/spec/super_good/solidus_taxjar/api_params_spec.rb
+++ b/spec/super_good/solidus_taxjar/api_params_spec.rb
@@ -10,7 +10,8 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do
ship_address: ship_address,
shipment_total: BigDecimal("3.01"),
store: store,
- total: order_total
+ total: order_total,
+ user_id: 12345
).tap do |order|
order.update! completed_at: DateTime.new(2018, 3, 6, 12, 10, 33)
end
@@ -123,6 +124,7 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do
it "returns params for fetching the tax for the order" do
expect(subject).to eq(
+ customer_id: "12345",
to_country: "US",
to_zip: "90210",
to_city: "Los Angeles",
@@ -154,6 +156,7 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do
it "excludes the line item" do
expect(subject).to eq(
+ customer_id: "12345",
to_country: "US",
to_zip: "90210",
to_city: "Los Angeles",
@@ -190,6 +193,7 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do
it "returns params for creating/updating an order transaction" do
expect(subject).to eq({
amount: BigDecimal("113.58"),
+ customer_id: "12345",
sales_tax: BigDecimal("9.87"),
shipping: BigDecimal("3.01"),
to_city: "Los Angeles",
@@ -249,6 +253,7 @@ RSpec.describe SuperGood::SolidusTaxJar::APIParams do
it "excludes the line item" do
expect(subject).to eq({
amount: BigDecimal("113.58"),
+ customer_id: "12345",
sales_tax: BigDecimal("9.87"),
shipping: BigDecimal("3.01"),
to_city: "Los Angeles",