Sha256: 98ec5557b61b8f4f4f42da676dea713814d202f5bc4691a6a50502c08be45f65
Contents?: true
Size: 793 Bytes
Versions: 6
Compression:
Stored size: 793 Bytes
Contents
module Spree module Tax # Used to build shipping rate taxes class ShippingRateTaxer # Build shipping rate taxes for a shipping rate # Modifies the passed-in shipping rate with associated shipping rate taxes. # @param [Spree::ShippingRate] shipping_rate The shipping rate to add taxes to. # This parameter will be modified. # @return [Spree::ShippingRate] The shipping rate with associated tax objects def tax(shipping_rate) taxes = Spree::Config.shipping_rate_tax_calculator_class.new(shipping_rate.order).calculate(shipping_rate) taxes.each do |tax| shipping_rate.taxes.build( amount: tax.amount, tax_rate: tax.tax_rate ) end shipping_rate end end end end
Version data entries
6 entries across 6 versions & 1 rubygems