diff options
Diffstat (limited to 'lib/super_good/solidus_taxjar/api_params.rb')
-rw-r--r-- | lib/super_good/solidus_taxjar/api_params.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/super_good/solidus_taxjar/api_params.rb b/lib/super_good/solidus_taxjar/api_params.rb index 4e61253..f75713c 100644 --- a/lib/super_good/solidus_taxjar/api_params.rb +++ b/lib/super_good/solidus_taxjar/api_params.rb @@ -21,6 +21,18 @@ module SuperGood ] end + def transaction_params(order) + {} + .merge(order_address_params(order.tax_address)) + .merge( + transaction_id: order.number, + transaction_date: order.completed_at.to_formatted_s(:iso8601), + amount: order.total - order.additional_tax_total, + shipping: order.shipment_total, + sales_tax: order.additional_tax_total + ) + end + private def order_address_params(address) |