diff options
Diffstat (limited to 'lib/super_good/solidus_taxjar')
-rw-r--r-- | lib/super_good/solidus_taxjar/api_params.rb | 8 |
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, |