summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar
diff options
context:
space:
mode:
authorJared Norman <jared@super.gd>2019-05-13 20:17:01 -0700
committerGitHub <noreply@github.com>2019-05-13 20:17:01 -0700
commit63304a7f88315964ab4f68451a317077a3313615 (patch)
tree82f968180aa77a9d9866cd22c0f0fa673accf1dd /lib/super_good/solidus_taxjar
parentbad2510206323f9aba70b8f086bc1f6defe0e6ec (diff)
parent25c28ac69ba771318382d26c3346c0d36bce8990 (diff)
Merge pull request #12 from SuperGoodSoft/customer-support
Customer Support
Diffstat (limited to 'lib/super_good/solidus_taxjar')
-rw-r--r--lib/super_good/solidus_taxjar/api_params.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/super_good/solidus_taxjar/api_params.rb b/lib/super_good/solidus_taxjar/api_params.rb
index 53b2c81..7c6942f 100644
--- a/lib/super_good/solidus_taxjar/api_params.rb
+++ b/lib/super_good/solidus_taxjar/api_params.rb
@@ -4,6 +4,7 @@ module SuperGood
class << self
def order_params(order)
{}
+ .merge(customer_params(order))
.merge(order_address_params(order.tax_address))
.merge(line_items_params(order.line_items))
.merge(shipping: order.shipment_total)
@@ -23,6 +24,7 @@ module SuperGood
def transaction_params(order)
{}
+ .merge(customer_params(order))
.merge(order_address_params(order.tax_address))
.merge(transaction_line_items_params(order.line_items))
.merge(
@@ -51,6 +53,12 @@ module SuperGood
private
+ def customer_params(order)
+ return {} unless order.user_id
+
+ { customer_id: order.user_id.to_s }
+ end
+
def order_address_params(address)
{
to_country: address.country.iso,