Skip to content

Commit

Permalink
Update app to include service for AvaTax api.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelsey Langlois and LDevinMacKrell committed Dec 7, 2017
1 parent eae8dbe commit f41b2c4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/models/tax_rate.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class TaxRate
def self.get_tax_rate
response = RestClient::Request.execute(
method: :get,
url: 'https://sandbox-rest.avatax.com/api/v2/taxrates/bypostalcode?country=US&postalCode=98105',
headers: { Authorization: ENV['AVATAX_KEY'] }
)
return JSON.parse(response)['totalRate']
end
end
1 change: 1 addition & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,5 @@
c.filter_sensitive_data('<publishable_key>') { ENV['PUBLISHABLE_KEY'] }
c.filter_sensitive_data('<secret_key>') { ENV['SECRET_KEY'] }
c.filter_sensitive_data('<currencylayer_key>') { ENV['CURRENCYLAYERKEY'] }
c.filter_sensitive_data('<avatax_key>') { ENV['AVATAX_KEY'] }
end

0 comments on commit f41b2c4

Please sign in to comment.