Skip to content

Instantly share code, notes, and snippets.

@jetsgit
Created July 3, 2014 04:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jetsgit/9d2521ec8798f07e61d7 to your computer and use it in GitHub Desktop.
Save jetsgit/9d2521ec8798f07e61d7 to your computer and use it in GitHub Desktop.
require_dependency 'spree/calculator'
#
# This is a no-op calculator that just returns the existing value.
# We hook our tax calculations in SpreeAvatax::TaxComputer at the order level instead of here at the line item level
#
module Spree
class Calculator::Avatax < Calculator
class DoNotUseCompute < StandardError; end
class TooManyPossibleAdjustments < StandardError; end
def self.description
Spree.t(:avatax_description)
end
def compute(computable)
raise DoNotUseCompute.new("The avatax calculator should never use #compute")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment