Sha256: 203ba5f25a546439bb43c0e5e427ee4aafd081234d0a757f23dce48219186a36

Contents?: true

Size: 801 Bytes

Versions: 1

Compression:

Stored size: 801 Bytes

Contents

module Spree
  module Calculator::Shipping
    module Usps
      class FirstClassMailInternational < Spree::Calculator::Shipping::Usps::Base
        WEIGHT_LIMITS = { "US" => 3.5 }

        def self.geo_group
          :international
        end

        def self.service_code
          "#{SERVICE_CODE_PREFIX[geo_group]}:13" #First-Class MailĀ® International Letter
        end

        def self.description
          I18n.t("usps.first_class_mail_international")
        end


        protected
        def max_weight_for_country(country)
          # if weight in ounces > 3.5, then First Class Mail International is not available for the order
          # https://www.usps.com/ship/first-class-international.htm
          return WEIGHT_LIMITS[country.iso]
        end
      end
    end
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_active_shipping-1.0.0 app/models/spree/calculator/shipping/usps/first_class_mail_international.rb