summaryrefslogtreecommitdiff
path: root/lib/super_good/solidus_taxjar/api.rb
diff options
context:
space:
mode:
authorAdnan Abdulally <adnan.abdulally@printivity.com>2021-01-29 10:27:06 -0800
committerNoah Silvera <noah@super.gd>2021-03-17 07:11:08 -0700
commit37fa5e7c81ee44012c86eabb140db760d55eae3b (patch)
tree0d8b8b9efe31b8999f06b3d18ea5f6f50049ef96 /lib/super_good/solidus_taxjar/api.rb
parent51ff05c3de3500fdc6aee55e2919646028055286 (diff)
Rename classes that have API in their name to Api
This done so Zeitwerk can correctly can correctly load the class from the filename. Co-authored-by: Nick Van Doorn <nick@super.gd>
Diffstat (limited to 'lib/super_good/solidus_taxjar/api.rb')
-rw-r--r--lib/super_good/solidus_taxjar/api.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/super_good/solidus_taxjar/api.rb b/lib/super_good/solidus_taxjar/api.rb
index c9cc99f..ca6ff6c 100644
--- a/lib/super_good/solidus_taxjar/api.rb
+++ b/lib/super_good/solidus_taxjar/api.rb
@@ -1,6 +1,6 @@
module SuperGood
module SolidusTaxjar
- class API
+ class Api
def self.default_taxjar_client
::Taxjar::Client.new(
api_key: ENV.fetch("TAXJAR_API_KEY"),
@@ -16,7 +16,7 @@ module SuperGood
end
def tax_for(order)
- taxjar_client.tax_for_order(APIParams.order_params(order)).tap do |taxes|
+ taxjar_client.tax_for_order(ApiParams.order_params(order)).tap do |taxes|
next unless SuperGood::SolidusTaxjar.logging_enabled
Rails.logger.info(
@@ -26,19 +26,19 @@ module SuperGood
end
def tax_rate_for(address)
- taxjar_client.tax_for_order(APIParams.tax_rate_address_params(address)).rate
+ taxjar_client.tax_for_order(ApiParams.tax_rate_address_params(address)).rate
end
def tax_rates_for(address)
- taxjar_client.rates_for_location(*APIParams.address_params(address))
+ taxjar_client.rates_for_location(*ApiParams.address_params(address))
end
def create_transaction_for(order)
- taxjar_client.create_order APIParams.transaction_params(order)
+ taxjar_client.create_order ApiParams.transaction_params(order)
end
def update_transaction_for(order)
- taxjar_client.update_order APIParams.transaction_params(order)
+ taxjar_client.update_order ApiParams.transaction_params(order)
end
def delete_transaction_for(order)
@@ -46,11 +46,11 @@ module SuperGood
end
def create_refund_for(reimbursement)
- taxjar_client.create_refund APIParams.refund_params(reimbursement)
+ taxjar_client.create_refund ApiParams.refund_params(reimbursement)
end
def validate_spree_address(spree_address)
- taxjar_client.validate_address APIParams.validate_address_params(spree_address)
+ taxjar_client.validate_address ApiParams.validate_address_params(spree_address)
end
private