Created
July 3, 2014 04:06
-
-
Save jetsgit/9d2521ec8798f07e61d7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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