app/models/concerns/spree/shipment_provider/active_shipping.rb
# Unlike the label generation, the rates provide a uniform interface so we
# can implement it here instead of on each providers.
Unlike the label generation, the rates provide a uniform interface so we
can implement it here instead of on each providers.
Unlike the label generation the rates provide a uniform interface so we can implement it here instead of on each providers .
def estimate
      begin
        rates = io.find_rates(from_location, to_location, package_for_label).rates
        rate = rates.find_all {|r| r.service_name == @service_type}.sort_by(&:price).first
        rate.price.to_f / 100 if rate
      rescue ::ActiveShipping::ResponseError
      end
    end
def estimate begin rates = io . find_rates ( from_location , to_location , package_for_label ) . rates rate = rates . find_all { | r | r . service_name == @service_type } . sort_by ( & :price ) . first rate . price . to_f / 100 if rate rescue :: ActiveShipping :: ResponseError end end
Unlike the label generation, the rates provide a uniform interface so we
can implement it here instead of on each providers.
Unlike the label generation the rates provide a uniform interface so we can implement it here instead of on each providers .
# Do nothing, nil is returned which triggers the fallback price